Пример #1
0
        public void Alias()
        {
            var hasAlias        = TestingUtilities.GetContainsIndicatorPredicate(ConstructIndicator.References);
            var doesntHaveAlias = TestingUtilities.GetNegation(hasAlias);

            TestingUtilities.RunTests(hasAlias, aliasPositiveTests);
            TestingUtilities.RunTests(doesntHaveAlias, aliasNegativeTests);
        }
Пример #2
0
        public void Session()
        {
            var hasSession        = TestingUtilities.GetContainsIndicatorPredicate(ConstructIndicator.Session);
            var doesntHaveSession = TestingUtilities.GetNegation(hasSession);

            TestingUtilities.RunTests(hasSession, sessionPositiveTests);
            TestingUtilities.RunTests(doesntHaveSession, sessionNegativeTests);
        }
Пример #3
0
        public void Eval()
        {
            var hasEval        = TestingUtilities.GetContainsIndicatorPredicate(ConstructIndicator.Eval);
            var doesntHaveEval = TestingUtilities.GetNegation(hasEval);

            TestingUtilities.RunTests(hasEval, evalPositiveTests);
            TestingUtilities.RunTests(doesntHaveEval, evalNegativeTests);
        }
Пример #4
0
        public void DynamicCalls()
        {
            var hasDynamicCall = TestingUtilities.GetContainsIndicatorPredicate(
                ConstructIndicator.DynamicCall);
            var doesntHaveDynamicCall = TestingUtilities.GetNegation(hasDynamicCall);

            TestingUtilities.RunTests(hasDynamicCall, dynamicCallPositiveTests);
            TestingUtilities.RunTests(doesntHaveDynamicCall, dynamicCallNegativeTests);
        }
Пример #5
0
        public void DynamicDereference()
        {
            var hasDynamicDereference = TestingUtilities.GetContainsIndicatorPredicate(
                ConstructIndicator.DynamicDereference);
            var doesntHaveDynamicDereference = TestingUtilities.GetNegation(hasDynamicDereference);

            TestingUtilities.RunTests(hasDynamicDereference, dynamicDereferencePositiveTests);
            TestingUtilities.RunTests(doesntHaveDynamicDereference, dynamicDereferenceNegativeTests);
        }
Пример #6
0
        public void MySqlFunctions()
        {
            var hasMySqlFunction        = TestingUtilities.GetContainsIndicatorPredicate(ConstructIndicator.MySql);
            var doesntHaveMySqlFunction = TestingUtilities.GetNegation(hasMySqlFunction);

            TestingUtilities.RunTests(hasMySqlFunction, mySqlPositiveTests);
            TestingUtilities.RunTests(doesntHaveMySqlFunction, sessionPositiveTests);
            TestingUtilities.RunTests(doesntHaveMySqlFunction, evalPositiveTests);
        }
Пример #7
0
        public void ClassPresence()
        {
            var hasClass = TestingUtilities.GetContainsIndicatorPredicate(
                ConstructIndicator.ClassOrInterface);
            var doesntHaveClass = TestingUtilities.GetNegation(hasClass);

            TestingUtilities.RunTests(hasClass, classPresencePositiveTests);
            TestingUtilities.RunTests(doesntHaveClass, classPresenceNegativeTests);
        }
Пример #8
0
        public void SuperGlobalVar()
        {
            var hasSuperGlobalVar = TestingUtilities.GetContainsIndicatorPredicate(
                ConstructIndicator.SuperGlobalVariable);
            var doesntHaveSuperGlobalVar = TestingUtilities.GetNegation(hasSuperGlobalVar);

            TestingUtilities.RunTests(hasSuperGlobalVar, superGlobalVarPositiveTests);
            TestingUtilities.RunTests(doesntHaveSuperGlobalVar, superGlobalVarNegativeTests);
        }
Пример #9
0
        public void InheritanceDepth()
        {
            var inheritance0Predicate
                = TestingUtilities.GetQuantityPredicate(Quantity.MaxInheritanceDepth, 0);
            var inheritance2Predicate
                = TestingUtilities.GetQuantityPredicate(Quantity.MaxInheritanceDepth, 2);

            TestingUtilities.RunTests(inheritance0Predicate, inheritanceDepth0);
            TestingUtilities.RunTests(inheritance2Predicate, inheritanceDepth2);
        }
Пример #10
0
        public void MaxMethodOverridingDepth()
        {
            var overriding0Predicate
                = TestingUtilities.GetQuantityPredicate(Quantity.MaxMethodOverridingDepth, 0);
            var overriding1Predicate
                = TestingUtilities.GetQuantityPredicate(Quantity.MaxMethodOverridingDepth, 1);
            var overriding2Predicate
                = TestingUtilities.GetQuantityPredicate(Quantity.MaxMethodOverridingDepth, 2);

            TestingUtilities.RunTests(overriding0Predicate, overridingDepth0);
            TestingUtilities.RunTests(overriding1Predicate, overridingDepth1);
            TestingUtilities.RunTests(overriding2Predicate, overridingDepth2);
        }
Пример #11
0
        public void NumberOfSources()
        {
            var infoA   = TestingUtilities.GetInfo(singleSource);
            var infoB   = TestingUtilities.GetInfo(singleSource);
            var infoAB  = infoA.Merge(infoB);
            var infoAAB = infoA.Merge(infoAB);

            var sourceCn1Predicate = TestingUtilities.GetQuantityPredicate(Quantity.NumberOfSources, 1);
            var sourceCn2Predicate = TestingUtilities.GetQuantityPredicate(Quantity.NumberOfSources, 2);

            Assert.IsTrue(sourceCn1Predicate(infoA), "Single source A");
            Assert.IsTrue(sourceCn1Predicate(infoB), "Single source B");
            Assert.IsTrue(sourceCn2Predicate(infoAB), "Merged A B sources");
            Assert.IsTrue(sourceCn2Predicate(infoAAB), "Merged A A B source");
        }
Пример #12
0
        public void NumberOfLines()
        {
            var lines4Predicate = TestingUtilities.GetQuantityPredicate(Quantity.NumberOfLines, 4);
            var lines5Predicate = TestingUtilities.GetQuantityPredicate(Quantity.NumberOfLines, 5);
            var lines9Predicate = TestingUtilities.GetQuantityPredicate(Quantity.NumberOfLines, 9);

            TestingUtilities.RunTests(lines4Predicate, numberOfLines4);
            TestingUtilities.RunTests(lines5Predicate, numberOfLines5);

            // Test merging
            var info4 = TestingUtilities.GetInfo(numberOfLines4);
            var info5 = TestingUtilities.GetInfo(numberOfLines5);
            var info9 = info4.Merge(info5);

            Assert.IsTrue(lines9Predicate(info9), "Merging two files");
        }