|  | @@ -1,5 +1,6 @@
 | 
		
	
		
			
			| 1 | 1 |  using System;
 | 
		
	
		
			
			| 2 | 2 |  using System.Collections.Generic;
 | 
		
	
		
			
			|  | 3 | +using System.Linq;
 | 
		
	
		
			
			| 3 | 4 |  using System.Linq.Expressions;
 | 
		
	
		
			
			| 4 | 5 |  using Luticate2.Auth.Tests.DataAccess.Crud.Models;
 | 
		
	
		
			
			| 5 | 6 |  using Luticate2.Auth.Utils.Business.Converters;
 | 
		
	
	
		
			
			|  | @@ -17,7 +18,7 @@ using Xunit;
 | 
		
	
		
			
			| 17 | 18 |  
 | 
		
	
		
			
			| 18 | 19 |  namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 19 | 20 |  {
 | 
		
	
		
			
			| 20 |  | -    public class LuEfCrudTests
 | 
		
	
		
			
			|  | 21 | +    public class LuEfCrudTests : IDisposable
 | 
		
	
		
			
			| 21 | 22 |      {
 | 
		
	
		
			
			| 22 | 23 |          public class TableSimple1Dbo
 | 
		
	
		
			
			| 23 | 24 |          {
 | 
		
	
	
		
			
			|  | @@ -50,6 +51,20 @@ namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 50 | 51 |              }
 | 
		
	
		
			
			| 51 | 52 |          }
 | 
		
	
		
			
			| 52 | 53 |  
 | 
		
	
		
			
			|  | 54 | +        public class TableSimple1ModelDescriptor : LuObjectConverterDescriptor<table_simple_1, TableSimple1Dbo>
 | 
		
	
		
			
			|  | 55 | +        {
 | 
		
	
		
			
			|  | 56 | +            public TableSimple1ModelDescriptor()
 | 
		
	
		
			
			|  | 57 | +            {
 | 
		
	
		
			
			|  | 58 | +                AddStaticMemberConverter(model => model.id, dbo => dbo.Id);
 | 
		
	
		
			
			|  | 59 | +                AddStaticMemberConverter(model => model.name, dbo => dbo.Name);
 | 
		
	
		
			
			|  | 60 | +                AddStaticMemberConverter(model => model.priority, dbo => dbo.Priority);
 | 
		
	
		
			
			|  | 61 | +                AddStaticMemberConverter(model => model.comment, dbo => dbo.Comment);
 | 
		
	
		
			
			|  | 62 | +                AddStaticMemberConverter(model => model.optional_int, dbo => dbo.OptionalInt);
 | 
		
	
		
			
			|  | 63 | +                AddStaticMemberConverter(model => model.created_at, dbo => dbo.CreatedAt);
 | 
		
	
		
			
			|  | 64 | +                AddStaticMemberConverter(model => model.updated_at, dbo => dbo.UpdatedAt);
 | 
		
	
		
			
			|  | 65 | +            }
 | 
		
	
		
			
			|  | 66 | +        }
 | 
		
	
		
			
			|  | 67 | +
 | 
		
	
		
			
			| 53 | 68 |          public class TableSimple1DataAccess : LuEfCrudDataAccess<TableSimple1Dbo, table_simple_1, luticate2_unit_testsContext>
 | 
		
	
		
			
			| 54 | 69 |          {
 | 
		
	
		
			
			| 55 | 70 |              public TableSimple1DataAccess(IServiceProvider serviceProvider) : base(serviceProvider)
 | 
		
	
	
		
			
			|  | @@ -57,14 +72,30 @@ namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 57 | 72 |              }
 | 
		
	
		
			
			| 58 | 73 |          }
 | 
		
	
		
			
			| 59 | 74 |  
 | 
		
	
		
			
			| 60 |  | -        protected IServiceProvider GetServiceProvider()
 | 
		
	
		
			
			|  | 75 | +        public IServiceProvider ServiceProvider { get; set; }
 | 
		
	
		
			
			|  | 76 | +
 | 
		
	
		
			
			|  | 77 | +        public luticate2_unit_testsContext Luticate2UnitTestsContext { get; set; }
 | 
		
	
		
			
			|  | 78 | +
 | 
		
	
		
			
			|  | 79 | +        public LuEfCrudTests()
 | 
		
	
		
			
			| 61 | 80 |          {
 | 
		
	
		
			
			| 62 | 81 |              var services = new ServiceCollection();
 | 
		
	
		
			
			| 63 | 82 |              services.AddLuObjectConverterDescriptors();
 | 
		
	
		
			
			|  | 83 | +            // DB read
 | 
		
	
		
			
			| 64 | 84 |              services.AddSingleton<ILuObjectConverterDescriptor<TableSimple1Dbo, table_simple_1>, TableSimple1DboDescriptor>();
 | 
		
	
		
			
			|  | 85 | +            // DB write
 | 
		
	
		
			
			|  | 86 | +            services.AddSingleton<ILuObjectConverterDescriptor<table_simple_1, TableSimple1Dbo>, TableSimple1ModelDescriptor>();
 | 
		
	
		
			
			| 65 | 87 |  
 | 
		
	
		
			
			| 66 | 88 |              services.AddLuObjectConverters();
 | 
		
	
		
			
			| 67 |  | -            services.AddLuObjectConverterPoco<table_simple_1, TableSimple1Dbo>(); // DB read
 | 
		
	
		
			
			|  | 89 | +            // DB read
 | 
		
	
		
			
			|  | 90 | +            services.AddLuObjectConverterPoco<table_simple_1, TableSimple1Dbo>();
 | 
		
	
		
			
			|  | 91 | +            // DB write
 | 
		
	
		
			
			|  | 92 | +            services.AddLuObjectConverterPoco<TableSimple1Dbo, table_simple_1>();
 | 
		
	
		
			
			|  | 93 | +
 | 
		
	
		
			
			|  | 94 | +
 | 
		
	
		
			
			|  | 95 | +            services.AddSingleton<ILuConvertersTypeConverter>(new LuConvertersTypeConverter(new Dictionary<Type, Type>
 | 
		
	
		
			
			|  | 96 | +            {
 | 
		
	
		
			
			|  | 97 | +                {typeof(TableSimple1Dbo), typeof(table_simple_1)} // DB read
 | 
		
	
		
			
			|  | 98 | +            }));
 | 
		
	
		
			
			| 68 | 99 |  
 | 
		
	
		
			
			| 69 | 100 |              services.AddDbContext<luticate2_unit_testsContext>(options =>
 | 
		
	
		
			
			| 70 | 101 |              {
 | 
		
	
	
		
			
			|  | @@ -75,21 +106,47 @@ namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 75 | 106 |              }, ServiceLifetime.Transient);
 | 
		
	
		
			
			| 76 | 107 |  
 | 
		
	
		
			
			| 77 | 108 |              services.AddSingleton<TableSimple1DataAccess>();
 | 
		
	
		
			
			| 78 |  | -            services.AddSingleton<ILuConvertersTypeConverter>(new LuConvertersTypeConverter(new Dictionary<Type, Type>
 | 
		
	
		
			
			| 79 |  | -            {
 | 
		
	
		
			
			| 80 |  | -                {typeof(TableSimple1Dbo), typeof(table_simple_1)} // DB read
 | 
		
	
		
			
			| 81 |  | -            }));
 | 
		
	
		
			
			| 82 | 109 |  
 | 
		
	
		
			
			| 83 |  | -            var serviceProvider = services.BuildServiceProvider();
 | 
		
	
		
			
			| 84 |  | -            return serviceProvider;
 | 
		
	
		
			
			|  | 110 | +            ServiceProvider = services.BuildServiceProvider();
 | 
		
	
		
			
			|  | 111 | +            Luticate2UnitTestsContext = ServiceProvider.GetService<luticate2_unit_testsContext>();
 | 
		
	
		
			
			|  | 112 | +            Luticate2UnitTestsContext.table_simple_1.RemoveRange(Luticate2UnitTestsContext.table_simple_1);
 | 
		
	
		
			
			|  | 113 | +            Luticate2UnitTestsContext.SaveChanges();
 | 
		
	
		
			
			|  | 114 | +        }
 | 
		
	
		
			
			|  | 115 | +
 | 
		
	
		
			
			|  | 116 | +        public void Dispose()
 | 
		
	
		
			
			|  | 117 | +        {
 | 
		
	
		
			
			|  | 118 | +            Luticate2UnitTestsContext.table_simple_1.RemoveRange(Luticate2UnitTestsContext.table_simple_1);
 | 
		
	
		
			
			|  | 119 | +            Luticate2UnitTestsContext.SaveChanges();
 | 
		
	
		
			
			|  | 120 | +        }
 | 
		
	
		
			
			|  | 121 | +
 | 
		
	
		
			
			|  | 122 | +        protected void AddTableSimple1DataSet1()
 | 
		
	
		
			
			|  | 123 | +        {
 | 
		
	
		
			
			|  | 124 | +            Luticate2UnitTestsContext.table_simple_1.AddRange(new table_simple_1
 | 
		
	
		
			
			|  | 125 | +            {
 | 
		
	
		
			
			|  | 126 | +                name = "test2",
 | 
		
	
		
			
			|  | 127 | +                priority = 24,
 | 
		
	
		
			
			|  | 128 | +                comment = null,
 | 
		
	
		
			
			|  | 129 | +                optional_int = 1,
 | 
		
	
		
			
			|  | 130 | +                created_at = DateTime.Now,
 | 
		
	
		
			
			|  | 131 | +                updated_at = null
 | 
		
	
		
			
			|  | 132 | +            }, new table_simple_1
 | 
		
	
		
			
			|  | 133 | +            {
 | 
		
	
		
			
			|  | 134 | +                name = "test1",
 | 
		
	
		
			
			|  | 135 | +                priority = 42,
 | 
		
	
		
			
			|  | 136 | +                comment = null,
 | 
		
	
		
			
			|  | 137 | +                optional_int = null,
 | 
		
	
		
			
			|  | 138 | +                created_at = DateTime.Now,
 | 
		
	
		
			
			|  | 139 | +                updated_at = null
 | 
		
	
		
			
			|  | 140 | +            });
 | 
		
	
		
			
			|  | 141 | +            Luticate2UnitTestsContext.SaveChanges();
 | 
		
	
		
			
			| 85 | 142 |          }
 | 
		
	
		
			
			| 86 | 143 |  
 | 
		
	
		
			
			| 87 | 144 |          [Fact]
 | 
		
	
		
			
			| 88 | 145 |          public void TestSimpleReadFilter1()
 | 
		
	
		
			
			| 89 | 146 |          {
 | 
		
	
		
			
			| 90 |  | -            var serviceProvider = GetServiceProvider();
 | 
		
	
		
			
			|  | 147 | +            AddTableSimple1DataSet1();
 | 
		
	
		
			
			| 91 | 148 |  
 | 
		
	
		
			
			| 92 |  | -            var crudDataAccess = serviceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			|  | 149 | +            var crudDataAccess = ServiceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			| 93 | 150 |  
 | 
		
	
		
			
			| 94 | 151 |              var result = crudDataAccess.Read(LuPartialFieldsParser.Parse("*").Data, new LuPaginatedParamsDbo
 | 
		
	
		
			
			| 95 | 152 |              {
 | 
		
	
	
		
			
			|  | @@ -123,9 +180,9 @@ namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 123 | 180 |          [Fact]
 | 
		
	
		
			
			| 124 | 181 |          public void TestSimpleReadOrderBy1()
 | 
		
	
		
			
			| 125 | 182 |          {
 | 
		
	
		
			
			| 126 |  | -            var serviceProvider = GetServiceProvider();
 | 
		
	
		
			
			|  | 183 | +            AddTableSimple1DataSet1();
 | 
		
	
		
			
			| 127 | 184 |  
 | 
		
	
		
			
			| 128 |  | -            var crudDataAccess = serviceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			|  | 185 | +            var crudDataAccess = ServiceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			| 129 | 186 |  
 | 
		
	
		
			
			| 130 | 187 |              var result = crudDataAccess.Read(LuPartialFieldsParser.Parse("*").Data, new LuPaginatedParamsDbo
 | 
		
	
		
			
			| 131 | 188 |              {
 | 
		
	
	
		
			
			|  | @@ -173,11 +230,11 @@ namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 173 | 230 |          [Fact]
 | 
		
	
		
			
			| 174 | 231 |          public void TestSimpleReadOrderBy2()
 | 
		
	
		
			
			| 175 | 232 |          {
 | 
		
	
		
			
			| 176 |  | -            var serviceProvider = GetServiceProvider();
 | 
		
	
		
			
			|  | 233 | +            AddTableSimple1DataSet1();
 | 
		
	
		
			
			| 177 | 234 |  
 | 
		
	
		
			
			| 178 |  | -            var crudDataAccess = serviceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			|  | 235 | +            var crudDataAccess = ServiceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			| 179 | 236 |  
 | 
		
	
		
			
			| 180 |  | -            var partialRespone = new LuPartialFieldsDbo
 | 
		
	
		
			
			|  | 237 | +            var partialResponse = new LuPartialFieldsDbo
 | 
		
	
		
			
			| 181 | 238 |              {
 | 
		
	
		
			
			| 182 | 239 |                  Fields = new List<LuFieldDbo>
 | 
		
	
		
			
			| 183 | 240 |                  {
 | 
		
	
	
		
			
			|  | @@ -212,7 +269,7 @@ namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 212 | 269 |                  PerPage = 10
 | 
		
	
		
			
			| 213 | 270 |              };
 | 
		
	
		
			
			| 214 | 271 |  
 | 
		
	
		
			
			| 215 |  | -            var result = crudDataAccess.Read(partialRespone, paginationParams);
 | 
		
	
		
			
			|  | 272 | +            var result = crudDataAccess.Read(partialResponse, paginationParams);
 | 
		
	
		
			
			| 216 | 273 |              Assert.NotNull(result);
 | 
		
	
		
			
			| 217 | 274 |              Assert.Equal(LuStatus.Success.ToInt(), result.Status);
 | 
		
	
		
			
			| 218 | 275 |              var items = result.Data;
 | 
		
	
	
		
			
			|  | @@ -235,5 +292,156 @@ namespace Luticate2.Auth.Tests.DataAccess.Crud
 | 
		
	
		
			
			| 235 | 292 |              Assert.Null(item.Comment);
 | 
		
	
		
			
			| 236 | 293 |              Assert.Equal(1, item.OptionalInt);
 | 
		
	
		
			
			| 237 | 294 |          }
 | 
		
	
		
			
			|  | 295 | +
 | 
		
	
		
			
			|  | 296 | +        [Fact]
 | 
		
	
		
			
			|  | 297 | +        public void TestSimpleCreate1()
 | 
		
	
		
			
			|  | 298 | +        {
 | 
		
	
		
			
			|  | 299 | +            var crudDataAccess = ServiceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			|  | 300 | +
 | 
		
	
		
			
			|  | 301 | +            var partialInput = new LuPartialFieldsDbo
 | 
		
	
		
			
			|  | 302 | +            {
 | 
		
	
		
			
			|  | 303 | +                Fields = new List<LuFieldDbo>
 | 
		
	
		
			
			|  | 304 | +                {
 | 
		
	
		
			
			|  | 305 | +                    new LuFieldDbo
 | 
		
	
		
			
			|  | 306 | +                    {
 | 
		
	
		
			
			|  | 307 | +                        Parts = new List<string>
 | 
		
	
		
			
			|  | 308 | +                        {
 | 
		
	
		
			
			|  | 309 | +                            "*"
 | 
		
	
		
			
			|  | 310 | +                        }
 | 
		
	
		
			
			|  | 311 | +                    }
 | 
		
	
		
			
			|  | 312 | +                }
 | 
		
	
		
			
			|  | 313 | +            };
 | 
		
	
		
			
			|  | 314 | +
 | 
		
	
		
			
			|  | 315 | +            var partialResponse = new LuPartialFieldsDbo
 | 
		
	
		
			
			|  | 316 | +            {
 | 
		
	
		
			
			|  | 317 | +                Fields = new List<LuFieldDbo>
 | 
		
	
		
			
			|  | 318 | +                {
 | 
		
	
		
			
			|  | 319 | +                    new LuFieldDbo
 | 
		
	
		
			
			|  | 320 | +                    {
 | 
		
	
		
			
			|  | 321 | +                        Parts = new List<string>
 | 
		
	
		
			
			|  | 322 | +                        {
 | 
		
	
		
			
			|  | 323 | +                            "*"
 | 
		
	
		
			
			|  | 324 | +                        }
 | 
		
	
		
			
			|  | 325 | +                    }
 | 
		
	
		
			
			|  | 326 | +                }
 | 
		
	
		
			
			|  | 327 | +            };
 | 
		
	
		
			
			|  | 328 | +
 | 
		
	
		
			
			|  | 329 | +            var objects = new List<TableSimple1Dbo>
 | 
		
	
		
			
			|  | 330 | +            {
 | 
		
	
		
			
			|  | 331 | +                new TableSimple1Dbo
 | 
		
	
		
			
			|  | 332 | +                {
 | 
		
	
		
			
			|  | 333 | +                    Name = "test2",
 | 
		
	
		
			
			|  | 334 | +                    Priority = 24,
 | 
		
	
		
			
			|  | 335 | +                    Comment = null,
 | 
		
	
		
			
			|  | 336 | +                    OptionalInt = 1,
 | 
		
	
		
			
			|  | 337 | +                    CreatedAt = DateTime.Now,
 | 
		
	
		
			
			|  | 338 | +                    UpdatedAt = null
 | 
		
	
		
			
			|  | 339 | +                }, new TableSimple1Dbo
 | 
		
	
		
			
			|  | 340 | +                {
 | 
		
	
		
			
			|  | 341 | +                    Name = "test1",
 | 
		
	
		
			
			|  | 342 | +                    Priority = 42,
 | 
		
	
		
			
			|  | 343 | +                    Comment = null,
 | 
		
	
		
			
			|  | 344 | +                    OptionalInt = null,
 | 
		
	
		
			
			|  | 345 | +                    CreatedAt = DateTime.Now,
 | 
		
	
		
			
			|  | 346 | +                    UpdatedAt = null
 | 
		
	
		
			
			|  | 347 | +                }
 | 
		
	
		
			
			|  | 348 | +            };
 | 
		
	
		
			
			|  | 349 | +
 | 
		
	
		
			
			|  | 350 | +            var result = crudDataAccess.Create(partialResponse, partialInput, objects);
 | 
		
	
		
			
			|  | 351 | +
 | 
		
	
		
			
			|  | 352 | +            Assert.NotNull(result);
 | 
		
	
		
			
			|  | 353 | +            Assert.Equal(LuStatus.Success.ToInt(), result.Status);
 | 
		
	
		
			
			|  | 354 | +            var items = result.Data;
 | 
		
	
		
			
			|  | 355 | +            Assert.NotNull(items);
 | 
		
	
		
			
			|  | 356 | +            Assert.Equal(objects.Count, items.Count);
 | 
		
	
		
			
			|  | 357 | +
 | 
		
	
		
			
			|  | 358 | +            foreach (var o in items.Zip(objects, (added, origin) => new { Added = added, Origin = origin }))
 | 
		
	
		
			
			|  | 359 | +            {
 | 
		
	
		
			
			|  | 360 | +                Assert.NotNull(o.Added);
 | 
		
	
		
			
			|  | 361 | +                Assert.Equal(o.Origin.Name, o.Added.Name);
 | 
		
	
		
			
			|  | 362 | +                Assert.Equal(o.Origin.Priority, o.Added.Priority);
 | 
		
	
		
			
			|  | 363 | +                Assert.Equal(o.Origin.Comment, o.Added.Comment);
 | 
		
	
		
			
			|  | 364 | +                Assert.Equal(o.Origin.OptionalInt, o.Added.OptionalInt);
 | 
		
	
		
			
			|  | 365 | +            }
 | 
		
	
		
			
			|  | 366 | +        }
 | 
		
	
		
			
			|  | 367 | +
 | 
		
	
		
			
			|  | 368 | +        [Fact]
 | 
		
	
		
			
			|  | 369 | +        public void TestSimpleCreate2()
 | 
		
	
		
			
			|  | 370 | +        {
 | 
		
	
		
			
			|  | 371 | +            var crudDataAccess = ServiceProvider.GetRequiredService<TableSimple1DataAccess>();
 | 
		
	
		
			
			|  | 372 | +
 | 
		
	
		
			
			|  | 373 | +            var partialInput = new LuPartialFieldsDbo
 | 
		
	
		
			
			|  | 374 | +            {
 | 
		
	
		
			
			|  | 375 | +                Fields = new List<LuFieldDbo>
 | 
		
	
		
			
			|  | 376 | +                {
 | 
		
	
		
			
			|  | 377 | +                    new LuFieldDbo
 | 
		
	
		
			
			|  | 378 | +                    {
 | 
		
	
		
			
			|  | 379 | +                        Parts = new List<string>
 | 
		
	
		
			
			|  | 380 | +                        {
 | 
		
	
		
			
			|  | 381 | +                            "*"
 | 
		
	
		
			
			|  | 382 | +                        }
 | 
		
	
		
			
			|  | 383 | +                    }
 | 
		
	
		
			
			|  | 384 | +                }
 | 
		
	
		
			
			|  | 385 | +            };
 | 
		
	
		
			
			|  | 386 | +
 | 
		
	
		
			
			|  | 387 | +            var partialResponse = new LuPartialFieldsDbo
 | 
		
	
		
			
			|  | 388 | +            {
 | 
		
	
		
			
			|  | 389 | +                Fields = new List<LuFieldDbo>
 | 
		
	
		
			
			|  | 390 | +                {
 | 
		
	
		
			
			|  | 391 | +                    new LuFieldDbo
 | 
		
	
		
			
			|  | 392 | +                    {
 | 
		
	
		
			
			|  | 393 | +                        Parts = new List<string>
 | 
		
	
		
			
			|  | 394 | +                        {
 | 
		
	
		
			
			|  | 395 | +                            "id"
 | 
		
	
		
			
			|  | 396 | +                        }
 | 
		
	
		
			
			|  | 397 | +                    },
 | 
		
	
		
			
			|  | 398 | +                    new LuFieldDbo
 | 
		
	
		
			
			|  | 399 | +                    {
 | 
		
	
		
			
			|  | 400 | +                        Parts = new List<string>
 | 
		
	
		
			
			|  | 401 | +                        {
 | 
		
	
		
			
			|  | 402 | +                            "name"
 | 
		
	
		
			
			|  | 403 | +                        }
 | 
		
	
		
			
			|  | 404 | +                    }
 | 
		
	
		
			
			|  | 405 | +                }
 | 
		
	
		
			
			|  | 406 | +            };
 | 
		
	
		
			
			|  | 407 | +
 | 
		
	
		
			
			|  | 408 | +            var objects = new List<TableSimple1Dbo>
 | 
		
	
		
			
			|  | 409 | +            {
 | 
		
	
		
			
			|  | 410 | +                new TableSimple1Dbo
 | 
		
	
		
			
			|  | 411 | +                {
 | 
		
	
		
			
			|  | 412 | +                    Name = "test2",
 | 
		
	
		
			
			|  | 413 | +                    Priority = 24,
 | 
		
	
		
			
			|  | 414 | +                    Comment = null,
 | 
		
	
		
			
			|  | 415 | +                    OptionalInt = 1,
 | 
		
	
		
			
			|  | 416 | +                    CreatedAt = DateTime.Now,
 | 
		
	
		
			
			|  | 417 | +                    UpdatedAt = null
 | 
		
	
		
			
			|  | 418 | +                }, new TableSimple1Dbo
 | 
		
	
		
			
			|  | 419 | +                {
 | 
		
	
		
			
			|  | 420 | +                    Name = "test1",
 | 
		
	
		
			
			|  | 421 | +                    Priority = 42,
 | 
		
	
		
			
			|  | 422 | +                    Comment = null,
 | 
		
	
		
			
			|  | 423 | +                    OptionalInt = null,
 | 
		
	
		
			
			|  | 424 | +                    CreatedAt = DateTime.Now,
 | 
		
	
		
			
			|  | 425 | +                    UpdatedAt = null
 | 
		
	
		
			
			|  | 426 | +                }
 | 
		
	
		
			
			|  | 427 | +            };
 | 
		
	
		
			
			|  | 428 | +
 | 
		
	
		
			
			|  | 429 | +            var result = crudDataAccess.Create(partialResponse, partialInput, objects);
 | 
		
	
		
			
			|  | 430 | +
 | 
		
	
		
			
			|  | 431 | +            Assert.NotNull(result);
 | 
		
	
		
			
			|  | 432 | +            Assert.Equal(LuStatus.Success.ToInt(), result.Status);
 | 
		
	
		
			
			|  | 433 | +            var items = result.Data;
 | 
		
	
		
			
			|  | 434 | +            Assert.NotNull(items);
 | 
		
	
		
			
			|  | 435 | +            Assert.Equal(objects.Count, items.Count);
 | 
		
	
		
			
			|  | 436 | +
 | 
		
	
		
			
			|  | 437 | +            foreach (var o in items.Zip(objects, (added, origin) => new { Added = added, Origin = origin }))
 | 
		
	
		
			
			|  | 438 | +            {
 | 
		
	
		
			
			|  | 439 | +                Assert.NotNull(o.Added);
 | 
		
	
		
			
			|  | 440 | +                Assert.Equal(o.Origin.Name, o.Added.Name);
 | 
		
	
		
			
			|  | 441 | +                Assert.Equal(0, o.Added.Priority);
 | 
		
	
		
			
			|  | 442 | +                Assert.Null(o.Added.Comment);
 | 
		
	
		
			
			|  | 443 | +                Assert.Null(o.Added.OptionalInt);
 | 
		
	
		
			
			|  | 444 | +            }
 | 
		
	
		
			
			|  | 445 | +        }
 | 
		
	
		
			
			| 238 | 446 |      }
 | 
		
	
		
			
			| 239 | 447 |  }
 |