Beispiel #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();
    }
Beispiel #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();
    }
Beispiel #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();
    }
Beispiel #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();
    }
Beispiel #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);
    }
Beispiel #6
0
    public void Should_Have_Method()
    {
        IRestfulApiMethodMatcher builder = new RestfulApiMethodBuilder(RestfulApiMethod.List);

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