public void Matches_Parameter_Existence(string methodName, int parameterIndex) { var builder = new RestfulApiMethodBuilder(RestfulApiMethod.List); builder.HasParameter(parameterIndex); builder.IsMatch(CreateActionModel(methodName)).Should().BeTrue(); }
public void Matches_Method_Suffix(string suffix) { var builder = new RestfulApiMethodBuilder(RestfulApiMethod.List); builder.MatchSuffix(suffix); builder.IsMatch(CreateActionModel(nameof(MyActionName))).Should().BeTrue(); }
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(); }
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(); }
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); }
public void Should_Have_Method() { IRestfulApiMethodMatcher builder = new RestfulApiMethodBuilder(RestfulApiMethod.List); builder.Method.Should().Be(RestfulApiMethod.List); }