Ejemplo n.º 1
0
 public void GetReturnsClone() {
     var table = new InMemoryTable<Post, int>(new TestConfiguration());
     var post = new Post { Title = "Foo" };
     table.Insert(post);
     var returnedPost = table.Get(1);
     Assert.NotNull(returnedPost);
     Assert.Equal("Foo", returnedPost.Title);
     Assert.False(post == returnedPost);
     Assert.True(post.Equals(returnedPost));
 }
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 GetReturnsClone()
        {
            var table = new InMemoryTable <Post, int>(new TestConfiguration());
            var post  = new Post {
                Title = "Foo"
            };

            table.Insert(post);
            var returnedPost = table.Get(1);

            Assert.NotNull(returnedPost);
            Assert.Equal("Foo", returnedPost.Title);
            Assert.False(post == returnedPost);
            Assert.True(post.Equals(returnedPost));
        }
Ejemplo n.º 4
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.º 5
0
 public void GetReturnsNull() {
     var table = new InMemoryTable<Post, int>(new TestConfiguration());
     Assert.Null(table.Get(1));
 }
Ejemplo n.º 6
0
        public void GetReturnsNull()
        {
            var table = new InMemoryTable <Post, int>(new TestConfiguration());

            Assert.Null(table.Get(1));
        }