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

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

            defaultConvention.Cases
                             .Filter(testClass)
                             .Select(x => x.Name)
                             .ShouldEqual("PublicInstanceNoArgsVoid");
        }
Example #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");
        }
Example #4
0
        public void TheDefaultConventionShouldDiscoverClassesWhoseNameEndsWithTests()
        {
            var defaultConvention = new DefaultConvention();

            DiscoveredTestClasses(defaultConvention)
                .ShouldEqual(
                    typeof(NameEndsWithTests));
        }
Example #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");
        }