You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to test a method that is synchronous but calls an asynchronous method and I want to ensure that I use AsyncMethod().WaitAndUnwrapExceptions() instead of AsyncMethod.Result, however this is currently not easily testable since FluentAssertions automatically unwraps the exception.
This is in my opinion a pretty bad idea as it might lead to a false feeling of security when in reality it might cover up a bug, because in reality no one unwraps the exception if I use .Result and then I have to catch AggregateException instead of the contained exceptions.
Therefore I think it would be best to completely remove the automatic exception unwrapping from assertions. However, if that is not desired for backwards compatibility I would at least like an option to disable the unwrapping in my solution (similiarly to how I can configure how ShouldBeEquivalentTo works).
binderchri, DavidFlamme, drauch, fschmied and batkaevruslan