示例#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));
 }
示例#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")));
        }
示例#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));
        }
示例#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));
        }
示例#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));
        }
示例#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")));
        }
示例#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));
        }
示例#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")));
        }
示例#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));
 }
示例#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")));
 }
示例#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")));
 }
示例#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")));
 }
示例#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));
 }
示例#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));
 }