mirror of
https://github.com/junian/Standard.Licensing.git
synced 2026-04-25 13:55:53 +03:00
[GH-ISSUE #30] AssertThat throws error if Attribute or Feature deos not exist #25
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Standard.Licensing#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MikeWilliams-UK on GitHub (Apr 17, 2023).
Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/30
In a .Net Framework (4.6.2) application.
If you have a licence which has been generated with an attribue of "Random1" and when you validate it you try to get an attribute of "Random2" you get a System.NullReferenceException when using .AssertThat(lic => lic.AdditionalAttributes.Get("Random2")
Same happens if you specify a feature which does not exist in the licence.
I would expect both of these to gracefully fail validation with a message similar to "Attribute 'Random2' not present in the licence."
@SamKr commented on GitHub (Sep 30, 2024):
If anyone comes across this, the correct way to implement this can be found in @junian's tests projects for Standard.Licensing.
Example:
You can change
Sales Moduleinto anything you want, and it'll trigger the corresponding failure if it's not present in the license.@junian commented on GitHub (Oct 2, 2024):
Thanks for pointing that @SamKr