machine / machine.specifications

Machine.Specifications is a Context/Specification framework for .NET that removes language noise and simplifies tests.
MIT License
885 stars 178 forks source link

Use ValueTask and generic exceptions for catch #456

Closed robertcoltheart closed 2 years ago

robertcoltheart commented 2 years ago

The reason that the Only<T> function is being deprecated is that it breaks AAA testing, whereby the Action is actually also performing the Assert. Proper tests should be composed by calling Catch.Exception() and then asserting the exception type using exception.ShouldBeOfExactType<T>().