示例#1
0
    public void should_match_parameter_without_point_id([Values(null, Subject.StringPointId)] object?pointId)
    {
        var parameterInfo = typeof(Subject).GetMethod(nameof(Subject.Foo))?.GetParameters().Single(_ => _.ParameterType == typeof(bool)) !;

        // --arrange
        var unitId = new UnitId(parameterInfo, SpecialTag.Argument);
        var target = new IsParameterMarkedWithAttribute(pointId);

        // --act
        // --assert
        target.Matches(unitId).Should().BeFalse();
    }
示例#2
0
    public void should_not_match_if_tag_is_not_argument([Values(null, "tag")] object?tag)
    {
        var parameterInfo = typeof(Subject).GetMethod(nameof(Subject.Foo))?.GetParameters().Single(_ => _.ParameterType == typeof(string)) !;

        // --arrange
        var unitId = new UnitId(parameterInfo, tag);
        var target = new IsParameterMarkedWithAttribute(Subject.StringPointId);

        // --act
        // --assert
        target.Matches(unitId).Should().BeFalse();
    }
示例#3
0
    public void should_match_parameter_with_null_point_id()
    {
        var parameterInfo = typeof(Subject).GetMethod(nameof(Subject.Foo))?.GetParameters().Single(_ => _.ParameterType == typeof(int)) !;

        // --arrange
        var unitId = new UnitId(parameterInfo, SpecialTag.Argument);
        var target = new IsParameterMarkedWithAttribute();

        // --act
        // --assert
        target.Matches(unitId).Should().BeTrue();
    }