Ejemplo n.º 1
0
        public void GetByIdTest_ReturnsNotFound_WhenIdNotProvided()
        {
            //act
            var result = _blogController.GetById(null);

            //asert
            Assert.IsAssignableFrom <NotFoundObjectResult>(result.Result);
        }
Ejemplo n.º 2
0
        public async Task LoadBlogPost_Ok()
        {
            //Arrange
            var response = await _blogController.List();

            var blogPosts = response.GetModelFromViewResultResponse <IEnumerable <BlogPostViewModel> >();

            var blogPost = blogPosts.FirstOrDefault();

            //Act
            var loadResponse = await _blogController.GetById(blogPost.Id);

            //Assert
            Assert.True(loadResponse is ContentResult);
            Assert.True(loadResponse.CastActionResult <ContentResult>().Content != null);
        }