コード例 #1
0
        public void when_send_connectionString_should_connect_and_run_command()
        {
            var sqlServerDriver = new SQLServerDriver(_connectionstring);

            string sqlCommand = "use master;";

            Action action = () => sqlServerDriver.ExecuteCommand(sqlCommand);

            action.Should().NotThrow <Exception>();
        }
コード例 #2
0
        public void when_run_wrong_command_then_should_run_with_exception()
        {
            var sqlConnection   = new SqlConnection(_connectionstring);
            var sqlServerDriver = new SQLServerDriver(sqlConnection);

            string wrongSqlCommand = "use";

            Action action = () => sqlServerDriver.ExecuteCommand(wrongSqlCommand);

            action.Should().Throw <DatabaseDriverException>();
        }