Ejemplo n.º 1
0
        public void UpdateReturns0ForNonExistant()
        {
            var table = new InMemoryTable <Post, int>(new TestConfiguration());
            var post1 = new Post()
            {
                Title = "Foo"
            };

            Assert.Equal(0, table.Update(post1));
        }
Ejemplo n.º 2
0
 public void UpdateWorks() {
     var table = new InMemoryTable<Post, int>(new TestConfiguration());
     var post1 = new Post() { Title = "Foo" };
     table.Insert(post1);
     post1.Title = "Bar";
     table.Update(post1);
     var updatedPost = table.Get(1);
     Assert.False(post1 == updatedPost);
     Assert.True(post1.Equals(updatedPost));
     Assert.Equal("Bar", updatedPost.Title);
 }
Ejemplo n.º 3
0
        public void UpdateWorks()
        {
            var table = new InMemoryTable <Post, int>(new TestConfiguration());
            var post1 = new Post()
            {
                Title = "Foo"
            };

            table.Insert(post1);
            post1.Title = "Bar";
            table.Update(post1);
            var updatedPost = table.Get(1);

            Assert.False(post1 == updatedPost);
            Assert.True(post1.Equals(updatedPost));
            Assert.Equal("Bar", updatedPost.Title);
        }
Ejemplo n.º 4
0
 public void UpdateReturns0ForNonExistant() {
     var table = new InMemoryTable<Post, int>(new TestConfiguration());
     var post1 = new Post() { Title = "Foo" };
     Assert.Equal(0, table.Update(post1));
 }