[PR #47] Fix parsing of Expiration. Fix comparison of Expiration. Add unit tests. #49

Open
opened 2026-02-26 02:30:20 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/junian/Standard.Licensing/pull/47
Author: @skst
Created: 2/27/2025
Status: 🔄 Open

Base: masterHead: expiration-fixes


📝 Commits (2)

  • 2fb8ddb Fix parsing of Expiration. Fix comparison of Expiration. Add unit tests.
  • 316358b Remove breaking validation. Fix comparison of Expiration. Add unit tests.

📊 Changes

5 files changed (+138 additions, -16 deletions)

View changed files

📝 src/Standard.Licensing.Tests/LicenseSignatureTests.cs (+14 -4)
📝 src/Standard.Licensing.Tests/LicenseValidationTests.cs (+87 -5)
📝 src/Standard.Licensing/License.cs (+21 -4)
📝 src/Standard.Licensing/LicenseBuilder.cs (+10 -1)
📝 src/Standard.Licensing/Validation/LicenseValidationExtensions.cs (+6 -2)

📄 Description

This PR fixes #17.

  • The Expiration property was returning an Unspecified DateTime type. Added the AdjustToUniversal style to Parse.
  • Convert DateTime passed to ExpirationDate to UTC before comparing with Expiration property (which is UTC).
  • Added a validation to Expiration.set to ensure the incoming type is not Unspecified.
  • Added a validation to ExpiresAt to ensure the incoming type is not Unspecified.
  • Added more unit tests around ExpiresAt and Expiration.
  • All unit tests pass.

This is my first pull request ever. 🙂 I tried to add relevant tests and to maintain the project's coding style (indents, spaces not tabs, etc.). If I introduced an error or missed something, please let me know, and I will be happy to correct it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/junian/Standard.Licensing/pull/47 **Author:** [@skst](https://github.com/skst) **Created:** 2/27/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `expiration-fixes` --- ### 📝 Commits (2) - [`2fb8ddb`](https://github.com/junian/Standard.Licensing/commit/2fb8ddb63d9c88272c0e1282cafb5188b0e27166) Fix parsing of Expiration. Fix comparison of Expiration. Add unit tests. - [`316358b`](https://github.com/junian/Standard.Licensing/commit/316358b0a14e9c6e43d3b354051447b5d9917a06) Remove breaking validation. Fix comparison of Expiration. Add unit tests. ### 📊 Changes **5 files changed** (+138 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/Standard.Licensing.Tests/LicenseSignatureTests.cs` (+14 -4) 📝 `src/Standard.Licensing.Tests/LicenseValidationTests.cs` (+87 -5) 📝 `src/Standard.Licensing/License.cs` (+21 -4) 📝 `src/Standard.Licensing/LicenseBuilder.cs` (+10 -1) 📝 `src/Standard.Licensing/Validation/LicenseValidationExtensions.cs` (+6 -2) </details> ### 📄 Description This PR fixes #17. * The `Expiration` property was returning an **Unspecified** `DateTime` type. Added the **AdjustToUniversal** style to `Parse`. * Convert `DateTime` passed to `ExpirationDate` to UTC before comparing with `Expiration` property (which is UTC). * Added a validation to `Expiration.set` to ensure the incoming type is not **Unspecified**. * Added a validation to `ExpiresAt` to ensure the incoming type is not **Unspecified**. * Added more unit tests around `ExpiresAt` and `Expiration`. * All unit tests pass. This is my first pull request ever. 🙂 I tried to add relevant tests and to maintain the project's coding style (indents, spaces not tabs, etc.). If I introduced an error or missed something, please let me know, and I will be happy to correct it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Standard.Licensing#49
No description provided.