Skip to content

Commit

Permalink
CODE RUB: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdutoit authored Apr 28, 2024
1 parent 1b4982c commit 5f2cc34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public void ShouldThrowDbUpdateExceptionIfSqlExceptionIsNull()
.BeEquivalentTo(
expectation: expectedDbUpdateException,
config: options => options
.Excluding(ex => ex.TargetSite)
.Excluding(ex => ex.StackTrace)
.Excluding(ex => ex.Source)
.Excluding(ex => ex.InnerException.TargetSite)
.Excluding(ex => ex.InnerException.StackTrace)
.Excluding(ex => ex.InnerException.Source));
.Excluding(ex => ex.TargetSite)
.Excluding(ex => ex.StackTrace)
.Excluding(ex => ex.Source)
.Excluding(ex => ex.InnerException.TargetSite)
.Excluding(ex => ex.InnerException.StackTrace)
.Excluding(ex => ex.InnerException.Source));

this.sqlServerErrorBrokerMock.Verify(broker =>
broker.GetErrorCode(It.IsAny<SqlException>()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ private SqlException CreateSqlException(string message, int errorCode)
messageField.SetValue(sqlException, message);

FieldInfo errorCodeField = typeof(SqlException).GetField(
name: "_errorCode",
bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic);
name: "_errorCode",
bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic);

if (errorCodeField != null)
errorCodeField.SetValue(sqlException, errorCode);
Expand Down

0 comments on commit 5f2cc34

Please sign in to comment.