Files
speckle-sharp-sdk/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/ExceptionTests.cs
T
Adam Hathcock 9695ec8c51 SpeckleHttp coverage (#244)
* Show code coverage for dev

* SpeckleHttp coverage and moved base stuff around

* add SpeckleHttpTests
2025-03-07 10:48:01 +00:00

27 lines
723 B
C#

using FluentAssertions;
using Speckle.Sdk.Models.Extensions;
namespace Speckle.Sdk.Tests.Unit.Models.Extensions;
public class ExceptionTests
{
[Fact]
public void CanPrintAllInnerExceptions()
{
// Test with a single exception
var ex = new Exception("Some error");
var exMsg = ex.ToFormattedString();
exMsg.Should().NotBeNull();
// Test with an inner exception
var ex2 = new Exception("One or more errors occurred", ex);
var ex2Msg = ex2.ToFormattedString();
ex2Msg.Should().NotBeNull();
// Test with an aggregate exception
var ex3 = new AggregateException("One or more errors occurred", ex2);
var ex3Msg = ex3.ToFormattedString();
ex3Msg.Should().NotBeNull();
}
}