public void UpdateReturns0ForNonExistant() { var table = new InMemoryTable <Post, int>(new TestConfiguration()); var post1 = new Post() { Title = "Foo" }; Assert.Equal(0, table.Update(post1)); }
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); }
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); }
public void UpdateReturns0ForNonExistant() { var table = new InMemoryTable<Post, int>(new TestConfiguration()); var post1 = new Post() { Title = "Foo" }; Assert.Equal(0, table.Update(post1)); }