|
| 1 | +# Migrate to Awesome Assertions |
| 2 | + |
| 3 | +- Status: accepted |
| 4 | +- Deciders: Daniel Mackay, Luke Cooke, Anton Polkanov, Matt Parker |
| 5 | +- Date: 2025-03-26 |
| 6 | +- Tags: testing, unit-tests, assertions, awesome-assertions, fluent-assertions |
| 7 | + |
| 8 | +Technical Story: https://github.com/SSWConsulting/SSW.CleanArchitecture/pull/497 |
| 9 | + |
| 10 | +## Context and Problem Statement |
| 11 | + |
| 12 | +We have been using FluentAssertions for our unit tests. |
| 13 | + |
| 14 | +This library is great however, the project has now switched to a paid model. Versions 8 and beyond are free for open-source projects and non-commercial use, but commercial use requires a paid licence. |
| 15 | + |
| 16 | +Version 7 will remain fully open-source indefinitely and receive bugfixes and other important corrections. |
| 17 | + |
| 18 | +## Decision Drivers |
| 19 | + |
| 20 | +- Free for commercial use |
| 21 | +- Concise and readable assertions |
| 22 | + |
| 23 | +## Considered Options |
| 24 | + |
| 25 | +1. Shouldly |
| 26 | +2. Fluent Assertions (free version) |
| 27 | +3. Fluent Assertions (paid version) |
| 28 | +4. Native test framework assertions (e.g. xUnit/NUnit/TUnit) |
| 29 | +5. Awesome Assertions |
| 30 | + |
| 31 | +## Decision Outcome |
| 32 | + |
| 33 | +Chosen option: "Option 5 - Awesome Assertions", because we get the same experience as FluentAssertions, but it is free for commercial use. It is also easy to migrate from FluentAssertions to Awesome Assertions. |
| 34 | + |
| 35 | +## Pros and Cons of the Options <!-- optional --> |
| 36 | + |
| 37 | +### Option 1 - Shouldly |
| 38 | + |
| 39 | +https://docs.shouldly.org/ |
| 40 | + |
| 41 | +- ✅ Good assertion library |
| 42 | +- ✅ Free for commercial use |
| 43 | +- ❌ Would require a lot of work to migrate from FluentAssertions |
| 44 | +- ❌ Custom extensions would need to be rewritten |
| 45 | + |
| 46 | +### Option 2 - Fluent Assertions (free version) |
| 47 | + |
| 48 | +https://xceed.com/products/unit-testing/fluent-assertions/ |
| 49 | + |
| 50 | +- ✅ Great assertion library |
| 51 | +- ✅ Version 7 is Free for open-source projects and non-commercial use |
| 52 | +- ❌ Easy to upgrade to version 8, resulting in substantial licence fees |
| 53 | + |
| 54 | +### Option 3 - Fluent Assertions (paid version) |
| 55 | + |
| 56 | +https://xceed.com/products/unit-testing/fluent-assertions/ |
| 57 | + |
| 58 | +- ✅ Great assertion library |
| 59 | +- ❌ Substantial licence fees for commercial use. ($130 per developer per year. For SSW this would cost $7,410 per year for 57 developers) |
| 60 | + |
| 61 | +### Option 4 - Native test framework assertions (e.g. xUnit/NUnit/TUnit) |
| 62 | + |
| 63 | +- ✅ Free for commercial use |
| 64 | +- ✅ No additional dependencies |
| 65 | +- ❌ Assertions are not as readable as FluentAssertions |
| 66 | +- ❌ Would require a lot of work to migrate from FluentAssertions |
| 67 | +- ❌ Custom extensions would need to be rewritten |
| 68 | + |
| 69 | +### Option 5 - Awesome Assertions |
| 70 | + |
| 71 | +https://awesomeassertions.org/ |
| 72 | + |
| 73 | +- ✅ Great assertion library |
| 74 | +- ✅ Free for commercial use |
| 75 | +- ✅ Easy to migrate from FluentAssertions |
| 76 | +- ✅ Custom extensions will continue to work (with minor modifications) |
0 commit comments