Files
speckle-sharp-sdk/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/ExceptionTests.cs
T
Adam Hathcock 14d959834f Convert to Xunit (#196)
* xunit unit tests

* most pass with formatting

* convert objects to xunit

* remove nunit

* format

* merge fixes

* switch objects to fluent assertions

* update to fluent assertions

* more FA

* convert all to FA

* Format

* Fix tests

* formatting

* hopefully made credential test better

* Catch more specific exception

* use another more specific exception

* Fix tests

* update to xunit

* update packages
2025-01-09 15:32:28 +00:00

28 lines
736 B
C#

using FluentAssertions;
using Speckle.Sdk.Models.Extensions;
using Xunit;
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();
}
}