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); }
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()); }
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()); }
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()); }
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()); }
public void sqlcop_test_user_aliases() { var result = _runner.Run("SQLCop", "test User Aliases"); Assert.IsTrue(result.Passed()); }
public void TestNewCustomerTest() { var result = _runner.Run("TestCustomer", "TestNewCustomerTest"); Assert.IsTrue(result.Passed()); }
public void AddNumberReturnsSumOfParameters() { var result = _runner.Run("DummyTests", "testDummyFunction"); Assert.IsTrue(result.Passed(), result.FailureMessages()); }