.Net TestStack.FluentMVCTesting

Great library for testing MVC with a fluent interface:

...
 _yourController
                .WithCallTo(c => c.yourAction(null,null))
                .ShouldRenderView("yourView")
                .WithModel<yourViewModel>(
                    m =>
                    {
                        m.YourField.Should().NotBeNull();
                        m.YourField.Count().Should().Be(1);

                        CallAnotherAssertionFunction(m.YourField.First());
                    })
                .AndNoModelErrors();
...

Leave a Reply

Your email address will not be published. Required fields are marked *