public void SortTest_LessQuestionMarksFirst() { var matcher1 = ClassMatcher.Create("MyClas?"); var matcher2 = ClassMatcher.Create("MyCla??"); var list = new List <ClassMatcher> { matcher2, matcher1 }; list.Sort(); list[0].Should().BeSameAs(matcher1); list[1].Should().BeSameAs(matcher2); }
public void SortTest_LongerNameFirstIfBothContainsStar() { var matcher1 = ClassMatcher.Create("My*Class"); var matcher2 = ClassMatcher.Create("*MyCl"); var list = new List <ClassMatcher> { matcher2, matcher1 }; list.Sort(); list[0].Should().Be(matcher1); list[1].Should().Be(matcher2); }
public void SortTest_ScopeDefsMatterLessThanNameLength() { var matcher1 = ClassMatcher.Create("MyClass"); var matcher2 = ClassMatcher.Create("[public]MyCl"); var list = new List <ClassMatcher> { matcher2, matcher1 }; list.Sort(); list[0].Should().BeSameAs(matcher1); list[1].Should().BeSameAs(matcher2); }
public void EmptyClassNameFails() { Action action = () => ClassMatcher.Create("[]"); action.Should().Throw <ArgumentException>(); }
public void PartialDefinitionGenericInstanceClass() { var matcher = ClassMatcher.Create("My*"); matcher.IsMatch(GetGenericTypeDefinition(typeof(MyGeneric <>), typeof(string))).Should().BeTrue(); }
public void PartialDefinitionGenericClass() { var matcher = ClassMatcher.Create("My*"); matcher.IsMatch(GetTypeDefinition(typeof(MyGeneric <>))).Should().BeTrue(); }
public void SealedPublicClassShouldBeConsideredAsPublic() { var matcher = ClassMatcher.Create("[public]My*"); matcher.IsMatch(GetTypeDefinition(typeof(MySealedClass))).Should().BeTrue(); }