public void TestSqlLiteAcceptsComputedColButDoesntWork() { //SETUP var options = SqliteInMemory.CreateOptions <MyEntityComputedColDbContext>(); using (var context = new MyEntityComputedColDbContext(options)) { context.Database.EnsureCreated(); //ATTEMPT context.Add(new MyEntity()); var ex = Assert.Throws <DbUpdateException>(() => context.SaveChanges()); //VERIFY Assert.StartsWith("SQLite Error 19: 'NOT NULL constraint failed:", ex.InnerException.Message); } }
public void TestInMemoryAcceptsComputedColButDoesntWork() { //SETUP var options = EfInMemory.CreateOptions <MyEntityComputedColDbContext>(); using (var context = new MyEntityComputedColDbContext(options)) { context.Database.EnsureCreated(); //ATTEMPT context.Add(new MyEntity()); context.SaveChanges(); //VERIFY context.Set <MyEntity>().First().MyDateTime.ShouldEqual(new DateTime()); } }