Skip to content

Conversation

@AlexArchive
Copy link
Contributor

If I understood correctly, this solves issue #40.

You will now be able to write custom assertion methods like this one:

public static class ControllerResultTestExtensions
{
    public static void ShouldGiveHttpUnauthorizedResult<TController>(
        this ControllerResultTest<TController> result) where TController : Controller
    {
        result.ValidateActionReturnType<HttpUnauthorizedResult>();
        var httpUnauthorizedResult = (HttpUnauthorizedResult) result.ActionResult;
        if (httpUnauthorizedResult.StatusCode != 1337)
        {
        }
    }
}

(Arbitrary example.)

We will need to update the documentation (and maybe add some XML comments in the future.)

@robdmoore
Copy link
Member

Nice! Thanks mate :)

robdmoore added a commit that referenced this pull request Nov 11, 2014
@robdmoore robdmoore merged commit 78594c5 into TestStack:master Nov 11, 2014
robdmoore added a commit that referenced this pull request Nov 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants