Example #1
0
        public void IndexActionShouldReturnSomePosts()
        {
            var sut = new HomeController();
            var action = sut.Index() as ViewResult;

            Assert.That(action.ViewData.Model, Is.InstanceOf(typeof(IList<Post>)));
        }
Example #2
0
 public void IndexACtionModelShouldNotBeEmpty()
 {
     var sut = new HomeController();
     var action = sut.Index() as ViewResult;
     var posts = action.ViewData.Model as IList<Post>;
     Assert.That(posts, Is.Not.Empty);
 }
Example #3
0
 public void PostShouldHaveABodyOfBoo()
 {
     var sut = new HomeController();
     var action = sut.Index() as ViewResult;
     var posts = action.ViewData.Model as IList<Post>;
     var actual = posts[0];
     Assert.That(actual.Body, Is.EqualTo("Boo"));
 }
Example #4
0
 public void IndexACtionSHouldDIsplayPosts()
 {
     var controller = new HomeController();
     var actual = controller.Index() as ViewResult;
     Assert.That(actual.ViewName, Is.EqualTo("Index"));
 }