Licensing
This section will describe all available My Tested ASP.NET Core MVC editions and their licensing options.
Editions
The testing library has four different editions available for you to explore:
Lite
The "Lite" edition of the library provides only a small subset of the available setups and assertions, but they are more than sufficient for controller and view component testing.
- Perfect for small MVC applications
- Completely free and unlimited
- Includes only "Controllers", "Controllers.Views" and "ViewComponents"
- Cannot be used in combination with any other package
- Requires manual mock creation of commonly used services
- Can be used by everyone
- Apache or Microsoft Public License
Community
The "Community" edition of the library is fully unlocked, and the whole fluent testing API can be used for free. This version is exclusively available only for individuals, open-source projects, startups, small businesses (up to 5 developers), and educational institutions.
- Perfect for every MVC application complying with the special terms
- Completely free and unlimited
- Developers can include any package they prefer
- Available only for individuals and special types of businesses and organizations
- Fully featured edition
- License codes can be requested from HERE for free
Trial
The "Trial" edition of the library is fully featured but allows up to 100 assertions (around 25 unit tests) per test project. You may use it in multiple projects to overcome this limitation or just write only a few tests with it (for example asserting very important routes in your application)
- Perfect for previewing the framework
- Completely free with limitations
- Allows up to 100 assertions (around 25 unit tests) per test project
- Developers can include any package they prefer
- Fully featured edition
- Can be used by everyone
- The limitation can be removed by providing a license code
Commercial
The "Commercial" edition of the library is fully unlocked and unlimited. Using it with .NET Core 3.0 or later requires a paid license code. All versions before 3.0 do not have such restrictions.
- Perfect for every MVC application
- No limitations
- Requires paid license code for .NET Core 3.0 or later
- Developers can include any package they prefer
- Fully featured edition
- Can be used by everyone
- License codes for .NET Core 3.0 or later can be purchased from HERE
Choose wisely! :)
Registering a license code
If you followed the tutorial strictly and your framework is .NET Core 3.0 or later, you should have reached the free trial version limitations of My Tested ASP.NET Core MVC. Otherwise, you may skip this section, and go test some Attributes!
Without a license code, when you run a single test (no matter which one), it should pass. But if you try to run them all at once, you should receive the following exception:
The free-quota limit of 100 assertions per test project has been reached. Please visit https://mytestedasp.net/core/mvc#pricing to request a free license or upgrade to a commercial one.
We will now register a license code in "MusicStore.Test" and remove this restriction. Create a "testsettings.json" file at the root of the project:
Then add the following JSON in it:
{
"License": "1-0GEPhlzJ+jgqzGg+hQPo19wbRvEN0C4LjGm9YDTErbLzcTROsj3fU177Unj7wlOCNE0ciZCB5aw8jt4EEDczpW6S/lW0PkU8ZBjqh6F2ev42hqcgtlEKmBRwomPKj/PUElAo1iIdkLn3/il3o8HAsum7bKMqv7QPpOSwy/TuAGYxOjIwMTctMTAtMTU6YWRtaW5AbXl0ZXN0ZWRhc3AubmV0Ok11c2ljIFN0b3JlIFNhbXBsZSBUZXN0czpEZXZlbG9wZXI6TXVzaWNTdG9yZS4="
}
This license is tied to the "MusicStore.Test" project. To unlock the testing framework limitations, we need to do one more thing. Set the "testsettings.json" file to be copied to the output directory or go to the "MusicStore.Test.csproj" and add these lines manually:
<!-- Other ItemGroups -->
<ItemGroup>
<Content Update="config.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="testsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- Other ItemGroups -->
From now on the "testsettings.json" file will be copied to the build output directory, and My Tested ASP.NET Core MVC will be able to read it successfully. More information about the test configuration can be found HERE.
Rebuild the solution and run the tests again. All of them should pass. We have unlocked the full version of the library! :)
Additional details about the licensing of the testing framework can be found HERE.
Section summary
Since now we have used the "Trial" edition of My Tested ASP.NET Core MVC. It was working fine, but we have reached its limitations while still having a lot of tests to write for our web application. After providing a license code in the test project, we are now able to successfully assert with the fully-featured and unlimited "Community" edition. Now let's get back to the code and test some Attributes!