Exemple #1
0
        public void DefaultConventionShouldDiscoverConcreteClassesFollowingNamingConventionAsTestClasses()
        {
            var defaultConvention = new DefaultConvention();

            defaultConvention.Classes
                             .Filter(CandidateTypes)
                             .Select(x => x.Name)
                             .ShouldEqual("PublicTests", "OtherPublicTests", "PublicWithNoDefaultConstructorTests",
                                          "PrivateTests", "OtherPrivateTests", "PrivateWithNoDefaultConstructorTests");
        }
Exemple #2
0
        public void DefaultConventionShouldTreatSynchronousPublicInstanceNoArgVoidMethodsAsCases()
        {
            var defaultConvention = new DefaultConvention();
            var testClass = typeof(DiscoveryTestClass);

            defaultConvention.Cases
                             .Filter(testClass)
                             .Select(x => x.Name)
                             .ShouldEqual("PublicInstanceNoArgsVoid");
        }
Exemple #3
0
        public void DefaultConventionShouldDiscoverSynchronousPublicInstanceVoidMethodsForTestCases()
        {
            var defaultConvention = new DefaultConvention();
            var testClass = typeof(DiscoveryTestClass);

            defaultConvention.Methods
                             .Filter(testClass)
                             .OrderBy(x => x.Name, StringComparer.Ordinal)
                             .Select(x => x.Name)
                             .ShouldEqual("PublicInstanceNoArgsVoid", "PublicInstanceWithArgsVoid");
        }
        public void TheDefaultConventionShouldDiscoverClassesWhoseNameEndsWithTests()
        {
            var defaultConvention = new DefaultConvention();

            DiscoveredTestClasses(defaultConvention)
                .ShouldEqual(
                    typeof(NameEndsWithTests));
        }
Exemple #5
0
        public void DefaultConventionShouldDiscoverAsyncPublicInstanceMethodsForTestCases()
        {
            var defaultConvention = new DefaultConvention();
            var testClass = typeof(AsyncDiscoveryTestClass);

            defaultConvention.Methods
                             .Filter(testClass)
                             .OrderBy(x => x.Name)
                             .Select(x => x.Name)
                             .ShouldEqual("PublicInstanceNoArgsVoid", "PublicInstanceNoArgsWithReturn",
                                          "PublicInstanceWithArgsVoid", "PublicInstanceWithArgsWithReturn");
        }