private static void CreateContext() { var options = new DbContextOptionsBuilder <ApplicationContextForTest>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .Options; context = new ApplicationContextForTest(options); context.Add(new ObjectMappingForTest() { Id = 1, IntValue = 2, StrValue = "2", SubObject = new SubObjectMappingForTest() { Id = 33, IntValueSub = 33, StrValueSub = "33" } }); context.Add(new ObjectMappingForTest() { Id = 2, IntValue = 22, StrValue = "23", SubObject = new SubObjectMappingForTest() { Id = 34, IntValueSub = 34, StrValueSub = "34" } }); context.Add(new ObjectMappingForTest() { Id = 3, IntValue = 23, StrValue = "23", SubObject = new SubObjectMappingForTest() { Id = 35, IntValueSub = 35, StrValueSub = "35" } }); _uow = new UnitOfWork(context); context.SaveChangesAsync(); }
private static void CreateContext() { var options = new DbContextOptionsBuilder <ApplicationContextForTest>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .Options; context = new ApplicationContextForTest(options); context.Add(new User() { Id = 1, Email = "*****@*****.**", Password = "******" }); context.Add(new User() { Id = 2, Email = "123l.ru", Password = "******" }); _uow = new UnitOfWork(context); context.SaveChangesAsync(); }