Skip to content

jrnail23/FluentAssertions.MVC

 
 

Repository files navigation

Project Description

FluentAssertions MVC is a set of MVC focused assertions and helper extensions to the excellent FluentAssertions library.

Installation

Follow the instructions for the version of MVC you are using. For MVC 3 and 4 just add the NuGet package. MVC 5 also requires a binding redirect.

MVC 5

Add the MVC 4 NuGet package to your unit test project:

PM> Install-Package FluentAssertions.Mvc4

And add the following binding redirect to you test project's app.config file:

<dependentAssembly>
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>

MVC 4

Add the MVC 4 NuGet package to your unit test project:

PM> Install-Package FluentAssertions.Mvc4

MVC 3

Add the MVC 3 NuGet package to your unit test project:

PM> Install-Package FluentAssertions.Mvc3

Getting Started

Write a unit test for your controller using one of the supported test frameworks. For exampe with NUnit:

[Test]
public void Index_Action_Returns_View()
{
    // Arrange
    var controller = new HomeController();

    // Act
    var result = controller.Index();

    // Assert
    result.Should().BeViewResult();
}

Continuous Integration

The build is generously hosted and run on the CodeBetter TeamCity infrastructure, courtesy of JetBrains.

Status of last build
master master

YouTrack and TeamCity

About

Fluent Assertions extensions for MVC

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 98.6%
  • Shell 1.4%