public static void AssemblyWithFact_ReturnsOneTestCaseOfTypeXunitTestCase() { var framework = TestableXunitTestFrameworkDiscoverer.Create(); var testClass = new XunitTestClass(Mocks.TestCollection(), Reflector.Wrap(typeof(ClassWithOneFact))); framework.FindTestsForClass(testClass); Assert.Collection(framework.Visitor.TestCases, testCase => Assert.IsType<XunitTestCase>(testCase) ); }
public static void AssemblyWithMixOfFactsAndNonTests_ReturnsTestCasesOnlyForFacts() { var framework = TestableXunitTestFrameworkDiscoverer.Create(); var testClass = new XunitTestClass(Mocks.TestCollection(), Reflector.Wrap(typeof(ClassWithMixOfFactsAndNonFacts))); framework.FindTestsForClass(testClass); Assert.Equal(2, framework.Visitor.TestCases.Count); Assert.Single(framework.Visitor.TestCases, t => t.DisplayName == "XunitTestFrameworkDiscovererTests+FindImpl+ClassWithMixOfFactsAndNonFacts.TestMethod1"); Assert.Single(framework.Visitor.TestCases, t => t.DisplayName == "XunitTestFrameworkDiscovererTests+FindImpl+ClassWithMixOfFactsAndNonFacts.TestMethod2"); }
public static void ClassWithNoTests_ReturnsNoTestCases() { var framework = TestableXunitTestFrameworkDiscoverer.Create(); var testClass = new XunitTestClass(Mocks.TestCollection(), Reflector.Wrap(typeof(ClassWithNoTests))); framework.FindTestsForClass(testClass); Assert.False(framework.Visitor.Finished.WaitOne(0)); }