Beispiel #1
0
        public void FilterWithTruePredicate()
        {
            var mate      = new TestableMultiAssemblyTestEnvironment();
            var assembly1 = mate.Load(CreateStubExecutor());
            var assembly2 = mate.Load(CreateStubExecutor("assembly", "config"));

            var tests = mate.EnumerateTestMethods(testMethod => true);

            Assert.Equal(8, tests.Count());
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                  tm.DisplayName == "ThisIsTheType.NonSkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                  tm.DisplayName == "ThisIsTheType.SkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                  tm.DisplayName == "This is a custom display name"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                  tm.DisplayName == "Monkey.DummyMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                  tm.DisplayName == "ThisIsTheType.NonSkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                  tm.DisplayName == "ThisIsTheType.SkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                  tm.DisplayName == "This is a custom display name"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                  tm.DisplayName == "Monkey.DummyMethod"));
        }
Beispiel #2
0
        public void FilterWithFalsePredicate()
        {
            var mate      = new TestableMultiAssemblyTestEnvironment();
            var assembly1 = mate.Load(CreateStubExecutor());
            var assembly2 = mate.Load(CreateStubExecutor("assembly", "config"));

            var tests = mate.EnumerateTestMethods(testMethod => false);

            Assert.Equal(0, tests.Count());
        }
        public void UnfilteredReturnsAllTestsFromAllClasses()
        {
            var mate = new TestableMultiAssemblyTestEnvironment();
            var assembly1 = mate.Load(CreateStubExecutor());
            var assembly2 = mate.Load(CreateStubExecutor("assembly", "config"));

            var tests = mate.EnumerateTestMethods();

            Assert.Equal(8, tests.Count());
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                        tm.DisplayName == "ThisIsTheType.NonSkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                        tm.DisplayName == "ThisIsTheType.SkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                        tm.DisplayName == "This is a custom display name"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 &&
                                        tm.DisplayName == "Monkey.DummyMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                        tm.DisplayName == "ThisIsTheType.NonSkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                        tm.DisplayName == "ThisIsTheType.SkipMethod"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                        tm.DisplayName == "This is a custom display name"));
            Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 &&
                                        tm.DisplayName == "Monkey.DummyMethod"));
        }
        public void FilterWithFalsePredicate()
        {
            var mate = new TestableMultiAssemblyTestEnvironment();
            var assembly1 = mate.Load(CreateStubExecutor());
            var assembly2 = mate.Load(CreateStubExecutor("assembly", "config"));

            var tests = mate.EnumerateTestMethods(testMethod => false);

            Assert.Equal(0, tests.Count());
        }