diff --git a/Xeption.Tests/XeptionTests.Logic.DataEqualsWithMessage.cs b/Xeption.Tests/XeptionTests.Logic.DataEqualsWithMessage.cs index f29b549..c098116 100644 --- a/Xeption.Tests/XeptionTests.Logic.DataEqualsWithMessage.cs +++ b/Xeption.Tests/XeptionTests.Logic.DataEqualsWithMessage.cs @@ -25,11 +25,11 @@ public void ShouldReturnTrueAndNullStringIfDataMatchInCount() Xeption actualXeption = expectedXeption.DeepClone(); // when - var actualComparisonResult = actualXeption.DataEqualsWithDetail(expectedXeption.Data); + (bool isEqual, string message) = actualXeption.DataEqualsWithDetail(expectedXeption.Data); // then - actualComparisonResult.IsEqual.Should().BeTrue(); - actualComparisonResult.Message.Should().BeNullOrEmpty(); + isEqual.Should().BeTrue(); + message.Should().BeNullOrEmpty(); } [Fact] @@ -58,12 +58,12 @@ public void ShouldReturnFalsAndMessageStringIfActualDataContainsKeysNotInExpecte expectedMessage.AppendLine($"- NOT contain key '{randomKey}'."); // when - var actualComparisonResult = actualXeption.DataEqualsWithDetail(expectedXeption.Data); + (bool isEqual, string message) = actualXeption.DataEqualsWithDetail(expectedXeption.Data); // then - actualComparisonResult.IsEqual.Should().BeFalse(); - actualComparisonResult.Message.Should().NotBeNullOrEmpty(); - actualComparisonResult.Message.Should().BeEquivalentTo(expectedMessage.ToString()); + isEqual.Should().BeFalse(); + message.Should().NotBeNullOrEmpty(); + message.Should().BeEquivalentTo(expectedMessage.ToString()); } [Fact] @@ -93,13 +93,13 @@ public void ShouldReturnFalseAndMessageStringIfExpectedDataContainsKeysNotInActu $"- contain key '{randomKey}' with value(s) [{randomValue}]."); // when - var actualComparisonResult = actualXeption + (bool isEqual, string message) = actualXeption .DataEqualsWithDetail(expectedXeption.Data); // then - actualComparisonResult.IsEqual.Should().BeFalse(); - actualComparisonResult.Message.Should().NotBeNullOrEmpty(); - actualComparisonResult.Message.Should().BeEquivalentTo(expectedMessage.ToString()); + isEqual.Should().BeFalse(); + message.Should().NotBeNullOrEmpty(); + message.Should().BeEquivalentTo(expectedMessage.ToString()); } [Fact] @@ -134,13 +134,13 @@ public void ShouldReturnFalseAndMessageStringIfExpectedDataContainsKeysMatchingK $"but found value(s) ['{actualValues}']."); // when - var actualComparisonResult = actualXeption + (bool isEqual, string message) = actualXeption .DataEqualsWithDetail(expectedXeption.Data); // then - actualComparisonResult.IsEqual.Should().BeFalse(); - actualComparisonResult.Message.Should().NotBeNullOrEmpty(); - actualComparisonResult.Message.Should().BeEquivalentTo(expectedMessage.ToString()); + isEqual.Should().BeFalse(); + message.Should().NotBeNullOrEmpty(); + message.Should().BeEquivalentTo(expectedMessage.ToString()); } } } \ No newline at end of file diff --git a/Xeption/Assertions/XeptionAssertions.cs b/Xeption/Assertions/XeptionAssertions.cs index a76ce5d..936a62c 100644 --- a/Xeption/Assertions/XeptionAssertions.cs +++ b/Xeption/Assertions/XeptionAssertions.cs @@ -80,8 +80,8 @@ private bool InnerExceptionsMatch( return false; } - var typeMatch = actual.GetType().FullName == expected.GetType().FullName; - var messageMatch = actual.Message == expected.Message; + bool typeMatch = actual.GetType().FullName == expected.GetType().FullName; + bool messageMatch = actual.Message == expected.Message; if (actual is AggregateException actualAggregate && expected is AggregateException expectedAggregate) { @@ -112,7 +112,7 @@ private bool InnerExceptionsMatch( var actualInnerExceptions = actualAggregate.InnerExceptions; var expectedInnerExceptions = expectedAggregate.InnerExceptions; - var countMatch = actualInnerExceptions.Count == expectedInnerExceptions.Count; + bool countMatch = actualInnerExceptions.Count == expectedInnerExceptions.Count; if (!countMatch) {