|
@@ -0,0 +1,520 @@
|
|
1
|
+using System;
|
|
2
|
+using System.Collections.Generic;
|
|
3
|
+using System.Linq;
|
|
4
|
+using Luticate2.Utils.Dbo;
|
|
5
|
+using Test.Utils.DataAccess;
|
|
6
|
+using Test.Utils.Dbo.PkBigSerial;
|
|
7
|
+using Test.Utils.Dbo.PkGuid;
|
|
8
|
+using Xunit;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+namespace Test.Utils.EfCrubDataAccess
|
|
12
|
+{
|
|
13
|
+ public class LuEfDeleteDataAccessTest
|
|
14
|
+ {
|
|
15
|
+ [Fact]
|
|
16
|
+ public void TestDeleteMultiple1()
|
|
17
|
+ {
|
|
18
|
+ Tests.TestRealDb(context =>
|
|
19
|
+ {
|
|
20
|
+ var dbos = new List<PkGuidAddDbo>
|
|
21
|
+ {
|
|
22
|
+ new PkGuidAddDbo
|
|
23
|
+ {
|
|
24
|
+ SomeInt = 42,
|
|
25
|
+ SomeText = "442"
|
|
26
|
+ },
|
|
27
|
+ new PkGuidAddDbo
|
|
28
|
+ {
|
|
29
|
+ SomeInt = 42,
|
|
30
|
+ SomeText = "42"
|
|
31
|
+ },
|
|
32
|
+ new PkGuidAddDbo
|
|
33
|
+ {
|
|
34
|
+ SomeInt = 24,
|
|
35
|
+ SomeText = "24"
|
|
36
|
+ }
|
|
37
|
+ };
|
|
38
|
+ var service = new LuUtilsPkGuidDataAccess(context);
|
|
39
|
+ var res = service.AddGuid(dbos);
|
|
40
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
41
|
+
|
|
42
|
+ var edit = service.Delete(guid => guid.some_int == 42, enumerable => enumerable);
|
|
43
|
+
|
|
44
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
45
|
+ var elements = edit.Data.ToList();
|
|
46
|
+ Assert.Equal(2, elements.Count);
|
|
47
|
+
|
|
48
|
+ var e = elements[0];
|
|
49
|
+ Assert.Equal(42, e.SomeInt);
|
|
50
|
+ Assert.Equal("442", e.SomeText);
|
|
51
|
+
|
|
52
|
+ e = elements[1];
|
|
53
|
+ Assert.Equal(42, e.SomeInt);
|
|
54
|
+ Assert.Equal("42", e.SomeText);
|
|
55
|
+
|
|
56
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
57
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
58
|
+ Assert.Equal(1, get.Data.Count);
|
|
59
|
+ Assert.Equal(1, get.Data.Data.Count);
|
|
60
|
+ var dbo = get.Data.Data[0];
|
|
61
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
62
|
+ Assert.Equal("24", dbo.SomeText);
|
|
63
|
+ });
|
|
64
|
+ }
|
|
65
|
+
|
|
66
|
+ [Fact]
|
|
67
|
+ public void TestDeleteMultiple2()
|
|
68
|
+ {
|
|
69
|
+ Tests.TestRealDb(context =>
|
|
70
|
+ {
|
|
71
|
+ var dbos = new List<PkGuidAddDbo>
|
|
72
|
+ {
|
|
73
|
+ new PkGuidAddDbo
|
|
74
|
+ {
|
|
75
|
+ SomeInt = 42,
|
|
76
|
+ SomeText = "442"
|
|
77
|
+ },
|
|
78
|
+ new PkGuidAddDbo
|
|
79
|
+ {
|
|
80
|
+ SomeInt = 42,
|
|
81
|
+ SomeText = "42"
|
|
82
|
+ },
|
|
83
|
+ new PkGuidAddDbo
|
|
84
|
+ {
|
|
85
|
+ SomeInt = 24,
|
|
86
|
+ SomeText = "24"
|
|
87
|
+ }
|
|
88
|
+ };
|
|
89
|
+ var service = new LuUtilsPkGuidDataAccess(context);
|
|
90
|
+ var res = service.AddGuid(dbos);
|
|
91
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
92
|
+
|
|
93
|
+ var edit = service.Delete(guid => guid.some_int == 42, enumerable => enumerable.Select(guidDbo => guidDbo.Id));
|
|
94
|
+
|
|
95
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
96
|
+ var elements = edit.Data.ToList();
|
|
97
|
+ Assert.Equal(2, elements.Count);
|
|
98
|
+
|
|
99
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
100
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
101
|
+ Assert.Equal(1, get.Data.Count);
|
|
102
|
+ Assert.Equal(1, get.Data.Data.Count);
|
|
103
|
+ var dbo = get.Data.Data[0];
|
|
104
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
105
|
+ Assert.Equal("24", dbo.SomeText);
|
|
106
|
+ });
|
|
107
|
+ }
|
|
108
|
+
|
|
109
|
+ [Fact]
|
|
110
|
+ public void TestDeleteMultiple3()
|
|
111
|
+ {
|
|
112
|
+ Tests.TestRealDb(context =>
|
|
113
|
+ {
|
|
114
|
+ var dbos = new List<PkGuidAddDbo>
|
|
115
|
+ {
|
|
116
|
+ new PkGuidAddDbo
|
|
117
|
+ {
|
|
118
|
+ SomeInt = 42,
|
|
119
|
+ SomeText = "442"
|
|
120
|
+ },
|
|
121
|
+ new PkGuidAddDbo
|
|
122
|
+ {
|
|
123
|
+ SomeInt = 42,
|
|
124
|
+ SomeText = "42"
|
|
125
|
+ },
|
|
126
|
+ new PkGuidAddDbo
|
|
127
|
+ {
|
|
128
|
+ SomeInt = 24,
|
|
129
|
+ SomeText = "24"
|
|
130
|
+ }
|
|
131
|
+ };
|
|
132
|
+ var service = new LuUtilsPkGuidDataAccess(context);
|
|
133
|
+ var res = service.AddGuid(dbos);
|
|
134
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
135
|
+
|
|
136
|
+ var edit = service.DeleteGuid(guid => guid.some_int == 42);
|
|
137
|
+
|
|
138
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
139
|
+ var elements = edit.Data.ToList();
|
|
140
|
+ Assert.Equal(2, elements.Count);
|
|
141
|
+
|
|
142
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
143
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
144
|
+ Assert.Equal(1, get.Data.Count);
|
|
145
|
+ Assert.Equal(1, get.Data.Data.Count);
|
|
146
|
+ var dbo = get.Data.Data[0];
|
|
147
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
148
|
+ Assert.Equal("24", dbo.SomeText);
|
|
149
|
+ });
|
|
150
|
+ }
|
|
151
|
+
|
|
152
|
+ [Fact]
|
|
153
|
+ public void TestDeleteMultiple4()
|
|
154
|
+ {
|
|
155
|
+ Tests.TestRealDb(context =>
|
|
156
|
+ {
|
|
157
|
+ var dbos = new List<PkBigSerialAddDbo>
|
|
158
|
+ {
|
|
159
|
+ new PkBigSerialAddDbo
|
|
160
|
+ {
|
|
161
|
+ SomeInt = 42,
|
|
162
|
+ SomeText = "442"
|
|
163
|
+ },
|
|
164
|
+ new PkBigSerialAddDbo
|
|
165
|
+ {
|
|
166
|
+ SomeInt = 42,
|
|
167
|
+ SomeText = "42"
|
|
168
|
+ },
|
|
169
|
+ new PkBigSerialAddDbo
|
|
170
|
+ {
|
|
171
|
+ SomeInt = 24,
|
|
172
|
+ SomeText = "24"
|
|
173
|
+ }
|
|
174
|
+ };
|
|
175
|
+ var service = new LuUtilsPkBigSerialDataAccess(context);
|
|
176
|
+ var res = service.AddId(dbos);
|
|
177
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
178
|
+
|
|
179
|
+ var edit = service.DeleteId(guid => guid.some_int == 42);
|
|
180
|
+
|
|
181
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
182
|
+ var elements = edit.Data.ToList();
|
|
183
|
+ Assert.Equal(2, elements.Count);
|
|
184
|
+
|
|
185
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
186
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
187
|
+ Assert.Equal(1, get.Data.Count);
|
|
188
|
+ Assert.Equal(1, get.Data.Data.Count);
|
|
189
|
+ var dbo = get.Data.Data[0];
|
|
190
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
191
|
+ Assert.Equal("24", dbo.SomeText);
|
|
192
|
+ });
|
|
193
|
+ }
|
|
194
|
+
|
|
195
|
+ [Fact]
|
|
196
|
+ public void TestDeleteMultiple5()
|
|
197
|
+ {
|
|
198
|
+ Tests.TestRealDb(context =>
|
|
199
|
+ {
|
|
200
|
+ var dbos = new List<PkGuidAddDbo>
|
|
201
|
+ {
|
|
202
|
+ new PkGuidAddDbo
|
|
203
|
+ {
|
|
204
|
+ SomeInt = 42,
|
|
205
|
+ SomeText = "442"
|
|
206
|
+ },
|
|
207
|
+ new PkGuidAddDbo
|
|
208
|
+ {
|
|
209
|
+ SomeInt = 42,
|
|
210
|
+ SomeText = "42"
|
|
211
|
+ },
|
|
212
|
+ new PkGuidAddDbo
|
|
213
|
+ {
|
|
214
|
+ SomeInt = 24,
|
|
215
|
+ SomeText = "24"
|
|
216
|
+ }
|
|
217
|
+ };
|
|
218
|
+ var service = new LuUtilsPkGuidDataAccess(context);
|
|
219
|
+ var res = service.AddGuid(dbos);
|
|
220
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
221
|
+
|
|
222
|
+ var edit = service.DeleteDbo(guid => guid.some_int == 42);
|
|
223
|
+
|
|
224
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
225
|
+ var elements = edit.Data.ToList();
|
|
226
|
+ Assert.Equal(2, elements.Count);
|
|
227
|
+
|
|
228
|
+ var e = elements[0];
|
|
229
|
+ Assert.Equal(42, e.SomeInt);
|
|
230
|
+ Assert.Equal("442", e.SomeText);
|
|
231
|
+
|
|
232
|
+ e = elements[1];
|
|
233
|
+ Assert.Equal(42, e.SomeInt);
|
|
234
|
+ Assert.Equal("42", e.SomeText);
|
|
235
|
+
|
|
236
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
237
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
238
|
+ Assert.Equal(1, get.Data.Count);
|
|
239
|
+ Assert.Equal(1, get.Data.Data.Count);
|
|
240
|
+ var dbo = get.Data.Data[0];
|
|
241
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
242
|
+ Assert.Equal("24", dbo.SomeText);
|
|
243
|
+ });
|
|
244
|
+ }
|
|
245
|
+
|
|
246
|
+ [Fact]
|
|
247
|
+ public void TestDeleteSingle1()
|
|
248
|
+ {
|
|
249
|
+ Tests.TestRealDb(context =>
|
|
250
|
+ {
|
|
251
|
+ var dbos = new List<PkGuidAddDbo>
|
|
252
|
+ {
|
|
253
|
+ new PkGuidAddDbo
|
|
254
|
+ {
|
|
255
|
+ SomeInt = 42,
|
|
256
|
+ SomeText = "442"
|
|
257
|
+ },
|
|
258
|
+ new PkGuidAddDbo
|
|
259
|
+ {
|
|
260
|
+ SomeInt = 42,
|
|
261
|
+ SomeText = "42"
|
|
262
|
+ },
|
|
263
|
+ new PkGuidAddDbo
|
|
264
|
+ {
|
|
265
|
+ SomeInt = 24,
|
|
266
|
+ SomeText = "24"
|
|
267
|
+ }
|
|
268
|
+ };
|
|
269
|
+ var service = new LuUtilsPkGuidDataAccess(context);
|
|
270
|
+ var res = service.AddGuid(dbos);
|
|
271
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
272
|
+
|
|
273
|
+ var ids = res.Data.ToList();
|
|
274
|
+
|
|
275
|
+ var edit = service.DeleteSingleById(ids[0], guidDbo => guidDbo);
|
|
276
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
277
|
+ Assert.Equal(42, edit.Data.SomeInt);
|
|
278
|
+ Assert.Equal("442", edit.Data.SomeText);
|
|
279
|
+
|
|
280
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
281
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
282
|
+ Assert.Equal(2, get.Data.Count);
|
|
283
|
+ Assert.Equal(2, get.Data.Data.Count);
|
|
284
|
+ var dbo = get.Data.Data[0];
|
|
285
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
286
|
+ Assert.Equal("24", dbo.SomeText);
|
|
287
|
+ dbo = get.Data.Data[1];
|
|
288
|
+ Assert.Equal(42, dbo.SomeInt);
|
|
289
|
+ Assert.Equal("42", dbo.SomeText);
|
|
290
|
+ });
|
|
291
|
+ }
|
|
292
|
+
|
|
293
|
+ [Fact]
|
|
294
|
+ public void TestDeleteSingle2()
|
|
295
|
+ {
|
|
296
|
+ Tests.TestRealDb(context =>
|
|
297
|
+ {
|
|
298
|
+ var dbos = new List<PkGuidAddDbo>
|
|
299
|
+ {
|
|
300
|
+ new PkGuidAddDbo
|
|
301
|
+ {
|
|
302
|
+ SomeInt = 42,
|
|
303
|
+ SomeText = "442"
|
|
304
|
+ },
|
|
305
|
+ new PkGuidAddDbo
|
|
306
|
+ {
|
|
307
|
+ SomeInt = 42,
|
|
308
|
+ SomeText = "42"
|
|
309
|
+ },
|
|
310
|
+ new PkGuidAddDbo
|
|
311
|
+ {
|
|
312
|
+ SomeInt = 24,
|
|
313
|
+ SomeText = "24"
|
|
314
|
+ }
|
|
315
|
+ };
|
|
316
|
+ var service = new LuUtilsPkGuidDataAccess(context);
|
|
317
|
+ var res = service.AddGuid(dbos);
|
|
318
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
319
|
+
|
|
320
|
+ var ids = res.Data.ToList();
|
|
321
|
+
|
|
322
|
+ var edit = service.DeleteSingleByIdGuid(ids[0]);
|
|
323
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
324
|
+
|
|
325
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
326
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
327
|
+ Assert.Equal(2, get.Data.Count);
|
|
328
|
+ Assert.Equal(2, get.Data.Data.Count);
|
|
329
|
+ var dbo = get.Data.Data[0];
|
|
330
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
331
|
+ Assert.Equal("24", dbo.SomeText);
|
|
332
|
+ dbo = get.Data.Data[1];
|
|
333
|
+ Assert.Equal(42, dbo.SomeInt);
|
|
334
|
+ Assert.Equal("42", dbo.SomeText);
|
|
335
|
+ });
|
|
336
|
+ }
|
|
337
|
+
|
|
338
|
+ [Fact]
|
|
339
|
+ public void TestDeleteSingle3()
|
|
340
|
+ {
|
|
341
|
+ Tests.TestRealDb(context =>
|
|
342
|
+ {
|
|
343
|
+ var dbos = new List<PkGuidAddDbo>
|
|
344
|
+ {
|
|
345
|
+ new PkGuidAddDbo
|
|
346
|
+ {
|
|
347
|
+ SomeInt = 42,
|
|
348
|
+ SomeText = "442"
|
|
349
|
+ },
|
|
350
|
+ new PkGuidAddDbo
|
|
351
|
+ {
|
|
352
|
+ SomeInt = 42,
|
|
353
|
+ SomeText = "42"
|
|
354
|
+ },
|
|
355
|
+ new PkGuidAddDbo
|
|
356
|
+ {
|
|
357
|
+ SomeInt = 24,
|
|
358
|
+ SomeText = "24"
|
|
359
|
+ }
|
|
360
|
+ };
|
|
361
|
+ var service = new LuUtilsPkGuidDataAccess(context);
|
|
362
|
+ var res = service.AddGuid(dbos);
|
|
363
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
364
|
+
|
|
365
|
+ var ids = res.Data.ToList();
|
|
366
|
+
|
|
367
|
+ var edit = service.DeleteSingleByIdDbo(ids[0]);
|
|
368
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
369
|
+
|
|
370
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
371
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
372
|
+ Assert.Equal(2, get.Data.Count);
|
|
373
|
+ Assert.Equal(2, get.Data.Data.Count);
|
|
374
|
+ var dbo = get.Data.Data[0];
|
|
375
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
376
|
+ Assert.Equal("24", dbo.SomeText);
|
|
377
|
+ dbo = get.Data.Data[1];
|
|
378
|
+ Assert.Equal(42, dbo.SomeInt);
|
|
379
|
+ Assert.Equal("42", dbo.SomeText);
|
|
380
|
+ });
|
|
381
|
+ }
|
|
382
|
+
|
|
383
|
+ [Fact]
|
|
384
|
+ public void TestDeleteSingle4()
|
|
385
|
+ {
|
|
386
|
+ Tests.TestRealDb(context =>
|
|
387
|
+ {
|
|
388
|
+ var dbos = new List<PkBigSerialAddDbo>
|
|
389
|
+ {
|
|
390
|
+ new PkBigSerialAddDbo
|
|
391
|
+ {
|
|
392
|
+ SomeInt = 42,
|
|
393
|
+ SomeText = "442"
|
|
394
|
+ },
|
|
395
|
+ new PkBigSerialAddDbo
|
|
396
|
+ {
|
|
397
|
+ SomeInt = 42,
|
|
398
|
+ SomeText = "42"
|
|
399
|
+ },
|
|
400
|
+ new PkBigSerialAddDbo
|
|
401
|
+ {
|
|
402
|
+ SomeInt = 24,
|
|
403
|
+ SomeText = "24"
|
|
404
|
+ }
|
|
405
|
+ };
|
|
406
|
+ var service = new LuUtilsPkBigSerialDataAccess(context);
|
|
407
|
+ var res = service.AddId(dbos);
|
|
408
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
409
|
+
|
|
410
|
+ var ids = res.Data.ToList();
|
|
411
|
+
|
|
412
|
+ var edit = service.DeleteSingleById(ids[0], guidDbo => guidDbo);
|
|
413
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
414
|
+ Assert.Equal(42, edit.Data.SomeInt);
|
|
415
|
+ Assert.Equal("442", edit.Data.SomeText);
|
|
416
|
+
|
|
417
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
418
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
419
|
+ Assert.Equal(2, get.Data.Count);
|
|
420
|
+ Assert.Equal(2, get.Data.Data.Count);
|
|
421
|
+ var dbo = get.Data.Data[0];
|
|
422
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
423
|
+ Assert.Equal("24", dbo.SomeText);
|
|
424
|
+ dbo = get.Data.Data[1];
|
|
425
|
+ Assert.Equal(42, dbo.SomeInt);
|
|
426
|
+ Assert.Equal("42", dbo.SomeText);
|
|
427
|
+ });
|
|
428
|
+ }
|
|
429
|
+
|
|
430
|
+ [Fact]
|
|
431
|
+ public void TestDeleteSingle5()
|
|
432
|
+ {
|
|
433
|
+ Tests.TestRealDb(context =>
|
|
434
|
+ {
|
|
435
|
+ var dbos = new List<PkBigSerialAddDbo>
|
|
436
|
+ {
|
|
437
|
+ new PkBigSerialAddDbo
|
|
438
|
+ {
|
|
439
|
+ SomeInt = 42,
|
|
440
|
+ SomeText = "442"
|
|
441
|
+ },
|
|
442
|
+ new PkBigSerialAddDbo
|
|
443
|
+ {
|
|
444
|
+ SomeInt = 42,
|
|
445
|
+ SomeText = "42"
|
|
446
|
+ },
|
|
447
|
+ new PkBigSerialAddDbo
|
|
448
|
+ {
|
|
449
|
+ SomeInt = 24,
|
|
450
|
+ SomeText = "24"
|
|
451
|
+ }
|
|
452
|
+ };
|
|
453
|
+ var service = new LuUtilsPkBigSerialDataAccess(context);
|
|
454
|
+ var res = service.AddId(dbos);
|
|
455
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
456
|
+
|
|
457
|
+ var ids = res.Data.ToList();
|
|
458
|
+
|
|
459
|
+ var edit = service.DeleteSingleByIdId(ids[0]);
|
|
460
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
461
|
+
|
|
462
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
463
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
464
|
+ Assert.Equal(2, get.Data.Count);
|
|
465
|
+ Assert.Equal(2, get.Data.Data.Count);
|
|
466
|
+ var dbo = get.Data.Data[0];
|
|
467
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
468
|
+ Assert.Equal("24", dbo.SomeText);
|
|
469
|
+ dbo = get.Data.Data[1];
|
|
470
|
+ Assert.Equal(42, dbo.SomeInt);
|
|
471
|
+ Assert.Equal("42", dbo.SomeText);
|
|
472
|
+ });
|
|
473
|
+ }
|
|
474
|
+
|
|
475
|
+ [Fact]
|
|
476
|
+ public void TestDeleteSingle6()
|
|
477
|
+ {
|
|
478
|
+ Tests.TestRealDb(context =>
|
|
479
|
+ {
|
|
480
|
+ var dbos = new List<PkBigSerialAddDbo>
|
|
481
|
+ {
|
|
482
|
+ new PkBigSerialAddDbo
|
|
483
|
+ {
|
|
484
|
+ SomeInt = 42,
|
|
485
|
+ SomeText = "442"
|
|
486
|
+ },
|
|
487
|
+ new PkBigSerialAddDbo
|
|
488
|
+ {
|
|
489
|
+ SomeInt = 42,
|
|
490
|
+ SomeText = "42"
|
|
491
|
+ },
|
|
492
|
+ new PkBigSerialAddDbo
|
|
493
|
+ {
|
|
494
|
+ SomeInt = 24,
|
|
495
|
+ SomeText = "24"
|
|
496
|
+ }
|
|
497
|
+ };
|
|
498
|
+ var service = new LuUtilsPkBigSerialDataAccess(context);
|
|
499
|
+ var res = service.AddId(dbos);
|
|
500
|
+ Assert.Equal(LuStatus.Success, res.Status);
|
|
501
|
+
|
|
502
|
+ var ids = res.Data.ToList();
|
|
503
|
+
|
|
504
|
+ var edit = service.DeleteSingleByIdDbo(ids[0]);
|
|
505
|
+ Assert.Equal(LuStatus.Success, edit.Status);
|
|
506
|
+
|
|
507
|
+ var get = service.GetMultiple(guid => guid.some_text);
|
|
508
|
+ Assert.Equal(LuStatus.Success, get.Status);
|
|
509
|
+ Assert.Equal(2, get.Data.Count);
|
|
510
|
+ Assert.Equal(2, get.Data.Data.Count);
|
|
511
|
+ var dbo = get.Data.Data[0];
|
|
512
|
+ Assert.Equal(24, dbo.SomeInt);
|
|
513
|
+ Assert.Equal("24", dbo.SomeText);
|
|
514
|
+ dbo = get.Data.Data[1];
|
|
515
|
+ Assert.Equal(42, dbo.SomeInt);
|
|
516
|
+ Assert.Equal("42", dbo.SomeText);
|
|
517
|
+ });
|
|
518
|
+ }
|
|
519
|
+ }
|
|
520
|
+}
|