Пример #1
0
        public void ExceptionsAreReturnedToCaller()
        {
            var          result   = ThrowsAny <Exception>(() => _commander.Query <int>());
            const string expected = "22012: division by zero";

            Equal(expected, result.Message);
        }
Пример #2
0
        public void ExceptionsAreReturnedToCaller()
        {
            var          result   = ThrowsAny <Exception>(() => _commander.Query <int>());
            const string expected = "Divide by zero error encountered.";

            Equal(expected, result.Message);
        }
Пример #3
0
        public void SupportsRollbackOnParameterlessCalls()
        {
            // get a count from [dbo].[Poco]
            // try to delete a record.
            //  throw exception
            // check count again. should match.

            var preCount  = _commander.Query <int>(method: "SupportsRollbackOnParameterlessCalls.Count");
            var result    = ThrowsAny <Exception>(() => _commander.Execute <bool>());
            var postCount = _commander.Query <int>(method: "SupportsRollbackOnParameterlessCalls.Count");

            Equal("22012: division by zero", result.Message);
            Equal(preCount, postCount);
        }
Пример #4
0
 private void CreateDatabase(string name = "Syrx")
 {
     // using Query to skip transactionality.
     _commander.Query <string>(new { name });
     Console.WriteLine($"{name} created!");
 }