当前位置: 首页 > 软件库 > 开发工具 > >

fluentassertions.mvc

Fluent Assertions extensions for ASP.NET MVC
授权协议 MS-PL License
开发语言 JavaScript
所属分类 开发工具
软件类型 开源软件
地区 不详
投 递 者 罗河
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Fluent Assertions for ASP.NET MVC

Build status

This repro contains the Fluent Assertions extensions for ASP.NET MVC. It is maintained by @kevinkuszyk.

Installation

Add the NuGet package which matches the version of MVC you are using to your test project.

MVC Core

Fluent Assertions for MVC Core is now in a seperate repository over at fluentassertions/fluentAssertions.aspnetcore.mvc.

MVC 5

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

PM> Install-Package FluentAssertions.Mvc5

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();
}

Building

Simply clone this repro and build the FluentAssertionsMvc.sln solution.