Ejemplo n.º 1
0
 private static TestSuites Run(tSQLtTestRunner testSession, TestCase test)
 {
     if (test != null && test.DisplayName != null && test.DisplayName.Contains("."))
     {
         return(testSession.Run(test.DisplayName.Split('.')[0], test.DisplayName.Split('.')[1]));
     }
     return(null);
 }
Ejemplo n.º 2
0
        public void exceptions_in_the_gateway_result_in_errors_being_returned()
        {
            const string expected_format = "exec tSQLtTestRunner.RunWithXmlResults [{0}].[{1}]";
            const string className = "this is the class";
            const string testName = "testipoos blah blah";

            string expected = string.Format(expected_format, className, testName);

            var gateway = new Mock<ISqlServerGateway>();
            gateway.Setup(p => p.RunWithXmlResult(It.IsAny<string>())).Returns<string>((query) =>
            {
                throw new InvalidOperationException("blah blah blah");
            });

            var tester = new tSQLtTestRunner(gateway.Object);
            var result = tester.Run(className, testName);

            Assert.IsFalse(result.Passed());
        }
Ejemplo n.º 3
0
        public void exceptions_in_the_gateway_result_in_errors_being_returned()
        {
            const string expected_format = "exec tSQLtTestRunner.RunWithXmlResults [{0}].[{1}]";
            const string className       = "this is the class";
            const string testName        = "testipoos blah blah";

            string expected = string.Format(expected_format, className, testName);

            var gateway = new Mock <ISqlServerGateway>();

            gateway.Setup(p => p.RunWithXmlResult(It.IsAny <string>())).Returns <string>((query) =>
            {
                throw new InvalidOperationException("blah blah blah");
            });

            var tester = new tSQLtTestRunner(gateway.Object);
            var result = tester.Run(className, testName);

            Assert.IsFalse(result.Passed());
        }
Ejemplo n.º 4
0
        public void single_test_runs_query_with_xml_results()
        {
            const string expected_format = "exec tSQLtTestRunner.RunWithXmlResults [{0}].[{1}]";
            const string className = "this is the class";
            const string testName = "testipoos blah blah";

            string expected = string.Format(expected_format, className, testName);

            var gateway = new Mock<ISqlServerGateway>();
            gateway.Setup(p => p.RunWithXmlResult(It.IsAny<string>())).Returns<string>((query) =>
            {
                Assert.AreEqual(expected, query);
                return DefaultXml;
            });

            var tester = new tSQLtTestRunner(gateway.Object);
            var result = tester.Run(className, testName);

            Assert.AreEqual(1, result.TestCount());
        }
Ejemplo n.º 5
0
        public void single_test_runs_query_with_xml_results()
        {
            const string expected_format = "exec tSQLtTestRunner.RunWithXmlResults [{0}].[{1}]";
            const string className       = "this is the class";
            const string testName        = "testipoos blah blah";

            string expected = string.Format(expected_format, className, testName);

            var gateway = new Mock <ISqlServerGateway>();

            gateway.Setup(p => p.RunWithXmlResult(It.IsAny <string>())).Returns <string>((query) =>
            {
                Assert.AreEqual(expected, query);
                return(DefaultXml);
            });


            var tester = new tSQLtTestRunner(gateway.Object);
            var result = tester.Run(className, testName);

            Assert.AreEqual(1, result.TestCount());
        }
Ejemplo n.º 6
0
        public void sqlcop_test_user_aliases()
        {
            var result = _runner.Run("SQLCop", "test User Aliases");

            Assert.IsTrue(result.Passed());
        }
Ejemplo n.º 7
0
        public void TestNewCustomerTest()
        {
            var result = _runner.Run("TestCustomer", "TestNewCustomerTest");

            Assert.IsTrue(result.Passed());
        }
Ejemplo n.º 8
0
        public void AddNumberReturnsSumOfParameters()
        {
            var result = _runner.Run("DummyTests", "testDummyFunction");

            Assert.IsTrue(result.Passed(), result.FailureMessages());
        }