Skip to content

Commit

Permalink
-Improved license error message
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Jun 5, 2017
1 parent 126f7db commit 6b842de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void LicenseValidation()

ExceptionAssert.Throws<JSchemaException>(() => LicenseHelpers.RegisterLicense(licenseText, new DateTime(2016, 12, 26, 0, 0, 0, DateTimeKind.Utc)), "Specified license is for testing only.");
ExceptionAssert.Throws<JSchemaException>(() => LicenseHelpers.RegisterLicense(licenseText, new DateTime(2016, 12, 27, 0, 0, 0, DateTimeKind.Utc)), "Specified license is for testing only.");
ExceptionAssert.Throws<JSchemaException>(() => LicenseHelpers.RegisterLicense(licenseText, new DateTime(2016, 12, 28, 0, 0, 0, DateTimeKind.Utc)), "License is not valid for this version of Json.NET Schema. License expired on 2016-12-27. This version of Json.NET Schema was released on 2016-12-28.");
ExceptionAssert.Throws<JSchemaException>(() => LicenseHelpers.RegisterLicense(licenseText, new DateTime(2016, 12, 28, 0, 0, 0, DateTimeKind.Utc)), "License is not valid for this version of Json.NET Schema. License free upgrade date expired on 2016-12-27. This version of Json.NET Schema was released on 2016-12-28.");

licenseText = "1001-BADqM5lisTgmXINQXrhM7jfbLxMs0Rkq8nF5V10yf4OMjSZQyI/IR8Oz9hfIyEs5hSzI8eX8dFb1KcKsMySTuQ/wHU6EKX6SzsBHzbOSxHhjR5XuBFUznGM+u1FyK7hGOxsyRZgBDS2rClcD/9bfn7SgitQU4nd1fGXnnQK1s5h7IklkIjoxMDAxLCJFeHBpcnlEYXRlIjoiMjAxNi0xMi0yN1QwMDowMDowMFoiLCJUeXBlIjoiVGVzdCJ9";
ExceptionAssert.Throws<JSchemaException>(() => LicenseHelpers.RegisterLicense(licenseText, new DateTime(2016, 12, 27, 0, 0, 0, DateTimeKind.Utc)), "License text does not match signature.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ internal static void RegisterLicense(string license, DateTime releaseDate)

if (deserializedLicense.ExpiryDate < releaseDate)
{
string message = "License is not valid for this version of Json.NET Schema. License expired on {0}. This version of Json.NET Schema was released on {1}.".FormatWith(
string message = "License is not valid for this version of Json.NET Schema. License free upgrade date expired on {0}. This version of Json.NET Schema was released on {1}.".FormatWith(
CultureInfo.InvariantCulture,
deserializedLicense.ExpiryDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture),
releaseDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
Expand Down

0 comments on commit 6b842de

Please sign in to comment.