Fluent Assertions for Unity
This package contains the current version of FluentAssertions 6.6.0 ready to use with Unity.
If you encouter any bugs, which are related to the package and not to FluentAssertions itself, feel free to open an issue.
For more information about FluentAssertions itself, please head over to https://fluentassertions.com.
- Unity 2019.1 or newer
- .NET Standard 2.0 scripting backend
openupm add com.boundfoxstudios.fluentassertions
Unity Package Manager
Window -> Package Manager -> + sign -> Add via git url:
Then, reference FluentAssertions in your test's assembly definition and you are good to go!
If you get the following error:
The type or namespace name 'DynamicMethod' could not be found (are you missing a using directive or an assembly reference?)or
The type or namespace name 'ILGenerator' could not be found (are you missing a using directive or an assembly reference?)
then you need to define the following scripting symbol (Edit -> Project Settings -> Player -> Other Settings -> Scripting Define Symbols):
Wait for Unity to recompile, the error should be gone then.
If not, please open an issue.
All credits go to FluentAssertions for creating an excellent library to make Unit Testing more readable and maintainable.