Skip to content

Commit

Permalink
show error when transaction is rolled back. use fixed length string.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahi committed Aug 7, 2020
1 parent b37ae68 commit 65e6ee7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions BVT/Data.BVT/OracleDatabaseFixtures/ExecuteNonQueryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ public void RecordsAreChangedWhenStoredProcTextAndTransactionIsCommitted()
db.ExecuteNonQuery(transaction, "DeleteCountry", new object[] { "SA" });
transaction.Commit();
}
catch (Exception)
catch (Exception ex)
{
transaction.Rollback();
Assert.Fail("Transaction Rolled back");
Assert.Fail("Transaction Rolled back: " + ex.Message);
}
finally
{
Expand Down
8 changes: 4 additions & 4 deletions BVT/Data.BVT/OracleDatabaseFixtures/ExecuteScalarFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public void ValueIsReturnedWhenUsingCOmmandAndOutParameter()
Database db = DatabaseFactory.CreateDatabase("OracleTest");
DbCommand dbCommand = db.GetStoredProcCommand("GetProductName");
db.AddInParameter(dbCommand, "vProductId", DbType.Int32, 1);
db.AddOutParameter(dbCommand, "vResult", DbType.String, 100);
db.AddOutParameter(dbCommand, "vResult", DbType.StringFixedLength, 100);
db.ExecuteScalar(dbCommand);
Assert.AreEqual("Product1", db.GetParameterValue(dbCommand, "vResult"));
Assert.AreEqual("Product1", db.GetParameterValue(dbCommand, "vResult").ToString().Trim());
}

[TestMethod]
Expand Down Expand Up @@ -163,10 +163,10 @@ public void RecordsAreSavedWhenUsingTextWithParametersAndTransactionIsCommitted(
db.ExecuteScalar(transaction, "DeleteCountry", new object[] { "SA" });
transaction.Commit();
}
catch (Exception)
catch (Exception ex)
{
transaction.Rollback();
Assert.Fail("Transaction Rolled back");
Assert.Fail("Transaction Rolled back: " + ex.Message);
}
finally
{
Expand Down

0 comments on commit 65e6ee7

Please sign in to comment.