Working with Redirects

Asserting on Expected Redirect Responses

Alba comes with some out of the box assertions to declaratively check expected redirects.

public Task asserting_redirects(IAlbaHost system)
{
    return system.Scenario(_ =>
    {
        // should redirect to the url
        _.RedirectShouldBe("/redirect");

        // should redirect permanently to the url
        _.RedirectPermanentShouldBe("/redirect");
    });
}

snippet source | anchor