Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        public void EmptyClassNameFails()
        {
            Action action = () => ClassMatcher.Create("[]");

            action.Should().Throw <ArgumentException>();
        }
Esempio n. 5
0
        public void PartialDefinitionGenericInstanceClass()
        {
            var matcher = ClassMatcher.Create("My*");

            matcher.IsMatch(GetGenericTypeDefinition(typeof(MyGeneric <>), typeof(string))).Should().BeTrue();
        }
Esempio n. 6
0
        public void PartialDefinitionGenericClass()
        {
            var matcher = ClassMatcher.Create("My*");

            matcher.IsMatch(GetTypeDefinition(typeof(MyGeneric <>))).Should().BeTrue();
        }
Esempio n. 7
0
        public void SealedPublicClassShouldBeConsideredAsPublic()
        {
            var matcher = ClassMatcher.Create("[public]My*");

            matcher.IsMatch(GetTypeDefinition(typeof(MySealedClass))).Should().BeTrue();
        }