public void ExceptionsAreReturnedToCaller() { var result = ThrowsAny <Exception>(() => _commander.Query <int>()); const string expected = "22012: division by zero"; Equal(expected, result.Message); }
public void ExceptionsAreReturnedToCaller() { var result = ThrowsAny <Exception>(() => _commander.Query <int>()); const string expected = "Divide by zero error encountered."; Equal(expected, result.Message); }
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); }
private void CreateDatabase(string name = "Syrx") { // using Query to skip transactionality. _commander.Query <string>(new { name }); Console.WriteLine($"{name} created!"); }