public void OneTestConfigured() { var testSpec = new TestSpec(); var testMethod1 = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Bar")); var testMethod2 = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Nope")); testSpec.AddTest(testMethod1); Assert.True(testSpec.Contains(testMethod1)); Assert.False(testSpec.Contains(testMethod2)); }
public void TestNameIsPrefixOfSecondTestNameViaITestMethod() { var testSpec = new TestSpec(); testSpec.AddTest(GetType().Assembly.GetName().Name, typeof(MockTestMethod).FullName, "Prefix"); Assert.True(testSpec.Contains(new MockTestMethod("Prefix"))); Assert.False(testSpec.Contains(new MockTestMethod("PrefixTestName"))); }
public void TestNameIsPrefixOfSecondTestName() { var testSpec = new TestSpec(); var testMethod1 = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Test1")); var testMethod2 = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Test1AsPrefix")); testSpec.AddTest(testMethod1); Assert.True(testSpec.Contains(testMethod1)); Assert.False(testSpec.Contains(testMethod2)); }
public void NoTestConfiguredWhenEmpty() { var testSpec = new TestSpec(); var testMethod = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Bar")); Assert.False(testSpec.Contains(testMethod)); }
public void CanSelectTestFixture() { var testSpec = new TestSpec(); testSpec.AddTest(GetType().Assembly.GetName().Name, typeof(MockTestMethod).FullName, string.Empty); Assert.True(testSpec.Contains(new MockTestMethod("Foo"))); }
public void AssemblyIsConfiguredWithAtLeastOneTest() { var testSpec = new TestSpec(); var testFixture = new TestFixture(typeof(Foo)); var testMethod = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Bar")); testSpec.AddTest(testMethod.AssemblyName, testMethod.DeclaringTypeFullName, testMethod.Name); Assert.True(testSpec.Contains(testFixture)); }
public void CanSelectNameSpace() { var testSpec = new TestSpec(); var nameSpaceName = typeof(MockTestMethod).FullName; var indexOfFirstDot = nameSpaceName.IndexOf('.'); nameSpaceName = nameSpaceName.Substring(0, indexOfFirstDot); testSpec.AddTest(GetType().Assembly.GetName().Name, nameSpaceName, string.Empty); Assert.True(testSpec.Contains(new MockTestMethod("Foo"))); }