コード例 #1
0
        public void ShouldUpdatenData()
        {
            var db = new TestDbContext();

            var data = db.SomeTestData.FirstOrDefault(x => x.MyTest == "Foo");
            data.MyTest = "FooBar";
            db.SomeTestData.SaveChanges();

            var changed = db.SomeTestData.FirstOrDefault(x => x.MyTest == "FooBar");

            Assert.AreEqual("FooBar", changed.MyTest);
        }
コード例 #2
0
 public void ShouldReturnData()
 {
     var db = new TestDbContext();
     var data = db.SomeTestData.FirstOrDefault(x => x.MyTest == "Foo");
     Assert.AreNotEqual(null, data);
 }
コード例 #3
0
 public void ShouldInitWithoutExistingData()
 {
     var db = new TestDbContext();
     Assert.AreEqual(0, db.MoreTestData.Count);
 }