Exemplo n.º 1
0
        public void GetCommentsReturnsNullWhenPostHasOneComment()
        {
            var user = new NullPropagation.User();
            user.Posts = new List<NullPropagation.Post> { new NullPropagation.Post { Id = 2 } };

            var comments = user.GetComments(2);
            Assert.Null(comments);
        }
Exemplo n.º 2
0
        public void GetCommentsReturnsNullWhenPostIsNull()
        {
            var user = new NullPropagation.User();

            var comments = user.GetComments(2);

            Assert.Null(comments);
        }
Exemplo n.º 3
0
        public void GetCommentsReturnsNullWhenPostIsNull()
        {
            var user = new NullPropagation.User();

            var comments = user.GetComments(2);

            Assert.Null(comments);
        }
Exemplo n.º 4
0
        public void GetCommentsReturnsOneWhenPostHasOneComment()
        {
            var user = new NullPropagation.User();
            user.Posts = new List<NullPropagation.Post>{
                new NullPropagation.Post { Id = 2,
                Comments =
                new List<NullPropagation.Comment> { new NullPropagation.Comment() }}};

            var comments = user.GetComments(2);
            Assert.Equal(1, comments.Value);
        }
Exemplo n.º 5
0
        public void GetCommentsReturnsNullWhenPostHasOneComment()
        {
            var user = new NullPropagation.User();

            user.Posts = new List <NullPropagation.Post> {
                new NullPropagation.Post {
                    Id = 2
                }
            };

            var comments = user.GetComments(2);

            Assert.Null(comments);
        }
Exemplo n.º 6
0
        public void GetCommentsReturnsOneWhenPostHasOneComment()
        {
            var user = new NullPropagation.User();

            user.Posts = new List <NullPropagation.Post> {
                new NullPropagation.Post {
                    Id       = 2,
                    Comments =
                        new List <NullPropagation.Comment> {
                        new NullPropagation.Comment()
                    }
                }
            };

            var comments = user.GetComments(2);

            Assert.Equal(1, comments.Value);
        }