Exemplo n.º 1
0
    public void Matches_Parameter_Existence(string methodName, int parameterIndex)
    {
        var builder = new RestfulApiMethodBuilder(RestfulApiMethod.List);

        builder.HasParameter(parameterIndex);

        builder.IsMatch(CreateActionModel(methodName)).Should().BeTrue();
    }
Exemplo n.º 2
0
    public void Matches_Method_Suffix(string suffix)
    {
        var builder = new RestfulApiMethodBuilder(RestfulApiMethod.List);

        builder.MatchSuffix(suffix);

        builder.IsMatch(CreateActionModel(nameof(MyActionName))).Should().BeTrue();
    }
Exemplo n.º 3
0
    public void Not_Matches_Method_ParameterCount(string actionName, int count)
    {
        var builder = new RestfulApiMethodBuilder(RestfulApiMethod.List);

        builder.MatchParameterCount(count);

        builder.IsMatch(CreateActionModel(actionName)).Should().BeFalse();
    }
Exemplo n.º 4
0
    public void Matches_Parameter_Prefix(string methodName, int parameterIndex, string parameterName)
    {
        var builder = new RestfulApiMethodBuilder(RestfulApiMethod.List);

        builder.MatchParameterPrefix(parameterIndex, parameterName);

        builder.IsMatch(CreateActionModel(methodName)).Should().BeTrue();
    }
Exemplo n.º 5
0
    public void Matches_Index_Based_Parameters(string name, bool toBe)
    {
        var builder = new RestfulApiMethodBuilder(RestfulApiMethod.Create);

        builder
        .MatchParameterName(^ 2, "id")
        .MatchParameterType(^ 1, typeof(IBaseRequest));

        builder.IsMatch(CreateActionModel(name)).Should().Be(toBe);
    }
Exemplo n.º 6
0
    public void Should_Have_Method()
    {
        IRestfulApiMethodMatcher builder = new RestfulApiMethodBuilder(RestfulApiMethod.List);

        builder.Method.Should().Be(RestfulApiMethod.List);
    }