Exemplo n.º 1
0
    public void ThrowIfContextIsNotHttpContext()
    {
        var context  = new Object();
        var strategy = new BasePathStrategy();

        Assert.Throws <AggregateException>(() => strategy.GetIdentifierAsync(context).Result);
    }
Exemplo n.º 2
0
    [InlineData("/initech/ignore/ignore", "initech")] // multiple path segments
    public async void ReturnExpectedIdentifier(string path, string expected)
    {
        var httpContext = CreateHttpContextMock(path);
        var strategy    = new BasePathStrategy();

        var identifier = await strategy.GetIdentifierAsync(httpContext);

        Assert.Equal(expected, identifier);
    }