Skip to content

Commit 67014df

Browse files
committed
Fixed exception message link in invalid license
1 parent fb81fa2 commit 67014df

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/MyTested.AspNetCore.Mvc.Licensing/TestCounter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void IncrementAndValidate()
4545
}
4646
catch (InvalidLicenseException ex)
4747
{
48-
invalidLicenseMessage = $"{(licenses == null ? string.Empty : $"You have invalid license: '{ex.Message}'. ")}The free-quota limit of {MaximumAllowedAssertions} assertions per test project has been reached. Please visit https://mytestedasp.net/products/mvc#pricing to request a free license or upgrade to a commercial one.";
48+
invalidLicenseMessage = $"{(licenses == null ? string.Empty : $"You have invalid license: '{ex.Message}'. ")}The free-quota limit of {MaximumAllowedAssertions} 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.";
4949
}
5050

5151
if (!LicenseValidator.HasValidLicense)

test/MyTested.AspNetCore.Mvc.Licensing.Test/TestCounterTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public void IncrementAndValidateShouldThrowExceptionWithNoLicense()
4343

4444
Assert.NotNull(caughtException);
4545
Assert.IsAssignableFrom<InvalidLicenseException>(caughtException);
46+
Assert.Equal("The free-quota limit of 500 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.", caughtException.Message);
4647
}
4748

4849
[Fact]
@@ -82,6 +83,7 @@ public void IncrementAndValidateShouldThrowExceptionWithInvalidLicense()
8283

8384
Assert.NotNull(caughtException);
8485
Assert.IsAssignableFrom<InvalidLicenseException>(caughtException);
86+
Assert.Equal("You have invalid license: 'License is not valid for this version of My Tested ASP.NET Core MVC. License expired on 2017-10-15. This version of My Tested ASP.NET Core MVC was released on 2018-10-10'. The free-quota limit of 500 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.", caughtException.Message);
8587
}
8688

8789
[Fact]

0 commit comments

Comments
 (0)