Esempio n. 1
0
 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));
 }
Esempio n. 2
0
        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")));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        public void NoTestConfiguredWhenEmpty()
        {
            var testSpec   = new TestSpec();
            var testMethod = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Bar"));

            Assert.False(testSpec.Contains(testMethod));
        }
Esempio n. 6
0
        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")));
        }
Esempio n. 7
0
        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));
        }
Esempio n. 8
0
        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")));
        }
Esempio n. 9
0
 public void NoTestConfiguredWhenEmpty() {
    var testSpec = new TestSpec();
    var testMethod = new TestMethod(new TestFixture(typeof(Foo)), typeof(Foo).GetMethod("Bar"));
    Assert.False(testSpec.Contains(testMethod));
 }
Esempio n. 10
0
 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")));
 }
Esempio n. 11
0
 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")));
 }
Esempio n. 12
0
 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")));
 }
Esempio n. 13
0
 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));
 }
Esempio n. 14
0
 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));
 }