Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ private static async Task<ThrowsExceptionState> IsThrowsAsyncFailingAsync<TExcep
FrameworkMessages.WrongExceptionThrown,
userMessage,
typeof(TException),
ex.GetType());
ex.GetType(),
ex.ToString());
ThrowAssertFailed("Assert." + assertMethodName, finalMessage);
}, ex);
}
Expand Down Expand Up @@ -577,7 +578,8 @@ private static ThrowsExceptionState IsThrowsFailing<TException>(Action action, b
FrameworkMessages.WrongExceptionThrown,
userMessage,
typeof(TException),
ex.GetType());
ex.GetType(),
ex.ToString());
ThrowAssertFailed("Assert." + assertMethodName, finalMessage);
}, ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Actual: {2}</value>
<value>Expected exception type:&lt;{1}&gt; but no exception was thrown. {0}</value>
</data>
<data name="WrongExceptionThrown" xml:space="preserve">
<value>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</value>
<value>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</value>
</data>
<data name="DataDrivenResultDisplayName" xml:space="preserve">
<value>{0} ({1})</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Skutečnost: {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Očekávaný typ výjimky: &lt;{1}&gt; Skutečný typ výjimky: &lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Tatsächlich: {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Erwarteter Ausnahmetyp:&lt;{1}&gt;. Tatsächlicher Ausnahmetyp:&lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Real: {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Tipo de excepción esperada:&lt;{1}&gt;. Tipo de excepción actual: &lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Réel : {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Type d’exception attendu :&lt;{1}&gt;. Type d’exception réel :&lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Effettivo: {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Tipo di eccezione previsto:&lt;{1}&gt;. Tipo di eccezione effettivo: &lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Actual: {2}</source>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">予期される例外の種類: &lt;{1}&gt;。実際の例外の種類: &lt;{2}&gt;{0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Actual: {2}</source>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">예상 예외 형식:&lt;{1}&gt;. 실제 예상 형식:&lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Rzeczywiste: {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Oczekiwano typu wyjątku:&lt;{1}&gt;. Rzeczywisty typ wyjątku:&lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Real: {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Tipo de exceção esperado:&lt;{1}&gt;. Tipo de exceção real:&lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Actual: {2}</source>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Ожидаемый тип исключения:&lt;{1}&gt;. Фактический тип исключения:&lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Gerçekte olan: {2}</target>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">Beklenen özel durum türü:&lt;{1}&gt;. Gerçek özel durum türü:&lt;{2}&gt;. {0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Actual: {2}</source>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">预期异常类型:&lt;{1}&gt;。实际异常类型:&lt;{2}&gt;{0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ Actual: {2}</source>
<note />
</trans-unit>
<trans-unit id="WrongExceptionThrown">
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. {0}</source>
<target state="translated">預期的例外狀況類型:&lt;{1}&gt;。實際的例外狀況類型:&lt;{2}&gt;{0}</target>
<source>Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</source>
<target state="new">Expected exception type:&lt;{1}&gt;. Actual exception type:&lt;{2}&gt;. Actual exception: {3} {0}</target>
<note />
</trans-unit>
<trans-unit id="DataDrivenResultDisplayName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void ThrowsAsync_WhenExceptionIsNotExpectedType_ShouldThrow()
Action action = t.Wait;
action.Should().Throw<AggregateException>()
.WithInnerException<AssertFailedException>()
.WithMessage("Assert.ThrowsAsync failed. Expected exception type:<System.ArgumentException>. Actual exception type:<System.Exception>. 'action' expression: '() => throw new Exception()'.");
.WithMessage("Assert.ThrowsAsync failed. Expected exception type:<System.ArgumentException>. Actual exception type:<System.Exception>. Actual exception: System.Exception: Exception of type 'System.Exception' was thrown.*'action' expression: '() => throw new Exception()'.");
}

public void ThrowsExactlyAsync_WhenExceptionIsDerivedFromExpectedType_ShouldThrow()
Expand All @@ -79,7 +79,7 @@ public void ThrowsExactlyAsync_WhenExceptionIsDerivedFromExpectedType_ShouldThro
Action action = t.Wait;
action.Should().Throw<AggregateException>()
.WithInnerException<AssertFailedException>()
.WithMessage("Assert.ThrowsExactlyAsync failed. Expected exception type:<System.ArgumentException>. Actual exception type:<System.ArgumentNullException>. 'action' expression: '() => throw new ArgumentNullException()'.");
.WithMessage("Assert.ThrowsExactlyAsync failed. Expected exception type:<System.ArgumentException>. Actual exception type:<System.ArgumentNullException>. Actual exception: System.ArgumentNullException: Value cannot be null.*'action' expression: '() => throw new ArgumentNullException()'.");
}

public void Throws_WithMessageBuilder_Passes()
Expand Down Expand Up @@ -122,7 +122,7 @@ public void Throws_WithMessageBuilder_FailsBecauseTypeMismatch()
return "message constructed via builder.";
});
action.Should().Throw<AssertFailedException>()
.WithMessage("Assert.Throws failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. 'action' expression: '() => throw new ArgumentOutOfRangeException(\"MyParamNameHere\")'. message constructed via builder.");
.WithMessage("Assert.Throws failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. Actual exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.*'action' expression: '() => throw new ArgumentOutOfRangeException(\"MyParamNameHere\")'. message constructed via builder.");

wasBuilderCalled.Should().BeTrue();
exceptionPassedToBuilder.Should().BeOfType<ArgumentOutOfRangeException>();
Expand Down Expand Up @@ -169,7 +169,7 @@ public void ThrowsExactly_WithMessageBuilder_FailsBecauseTypeMismatch()
return "message constructed via builder.";
});
action.Should().Throw<AssertFailedException>()
.WithMessage("Assert.ThrowsExactly failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. 'action' expression: '() => throw new ArgumentOutOfRangeException(\"MyParamNameHere\")'. message constructed via builder.");
.WithMessage("Assert.ThrowsExactly failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. Actual exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.*'action' expression: '() => throw new ArgumentOutOfRangeException(\"MyParamNameHere\")'. message constructed via builder.");

wasBuilderCalled.Should().BeTrue();
exceptionPassedToBuilder.Should().BeOfType<ArgumentOutOfRangeException>();
Expand Down Expand Up @@ -216,7 +216,7 @@ public async Task ThrowsAsync_WithMessageBuilder_FailsBecauseTypeMismatch()
return "message constructed via builder.";
});
(await action.Should().ThrowAsync<AssertFailedException>())
.WithMessage("Assert.ThrowsAsync failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. 'action' expression: '() => Task.FromException(new ArgumentOutOfRangeException(\"MyParamNameHere\"))'. message constructed via builder.");
.WithMessage("Assert.ThrowsAsync failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. Actual exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.*'action' expression: '() => Task.FromException(new ArgumentOutOfRangeException(\"MyParamNameHere\"))'. message constructed via builder.");

wasBuilderCalled.Should().BeTrue();
exceptionPassedToBuilder.Should().BeOfType<ArgumentOutOfRangeException>();
Expand Down Expand Up @@ -263,7 +263,7 @@ public async Task ThrowsExactlyAsync_WithMessageBuilder_FailsBecauseTypeMismatch
return "message constructed via builder.";
});
(await action.Should().ThrowAsync<AssertFailedException>())
.WithMessage("Assert.ThrowsExactlyAsync failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. 'action' expression: '() => Task.FromException(new ArgumentOutOfRangeException(\"MyParamNameHere\"))'. message constructed via builder.");
.WithMessage("Assert.ThrowsExactlyAsync failed. Expected exception type:<System.ArgumentNullException>. Actual exception type:<System.ArgumentOutOfRangeException>. Actual exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.*'action' expression: '() => Task.FromException(new ArgumentOutOfRangeException(\"MyParamNameHere\"))'. message constructed via builder.");

wasBuilderCalled.Should().BeTrue();
exceptionPassedToBuilder.Should().BeOfType<ArgumentOutOfRangeException>();
Expand Down
Loading