Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to main #63

Merged
merged 18 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3f5cad4
Adding subscription usage and plan info and validation, including CI …
jordimontana82 Jan 20, 2024
3dffafa
Adding environment reader and update subscription validator accessibi…
jordimontana82 Jan 20, 2024
b49e0ff
Introducing subscription monitoring to facilitate counting of users t…
jordimontana82 Jan 24, 2024
6fa4bf9
Updates to subscription usage and validation
jordimontana82 Jan 28, 2024
f49c5ba
Increase code coverage for subscription logic
jordimontana82 Jan 28, 2024
dfd1353
More tests added
jordimontana82 Jan 28, 2024
95da511
Increase code coverage
jordimontana82 Jan 29, 2024
cc3b57b
Merge pull request #54 from DynamicsValue/feature/licensing-user-moni…
jordimontana82 Jan 29, 2024
ad7ccaa
Update CHANGELOG.md
jordimontana82 Jan 31, 2024
c47133b
Merge pull request #55 from DynamicsValue/feature/licensing-user-moni…
jordimontana82 Jan 31, 2024
8976cf9
Change UserReader implementation for consistency with v3. Remove lega…
jordimontana82 Feb 3, 2024
e49ef22
Remove release notes DynamicsValue/fake-xrm-easy#115
jordimontana82 Feb 3, 2024
6aa6746
Merge pull request #57 from DynamicsValue/feature/licensing-tweaks
jordimontana82 Feb 3, 2024
863db20
Adding logging of current user name for troubleshooting during alpha …
jordimontana82 Feb 4, 2024
a5618c5
Merge pull request #59 from DynamicsValue/feature/2x-log-username-in-…
jordimontana82 Feb 4, 2024
169caa7
Several improvements
jordimontana82 Feb 4, 2024
3852754
Update remaining spots in actions to update SONAR var settings
jordimontana82 Feb 4, 2024
8e77a54
Merge pull request #61 from DynamicsValue/2x-improvements
jordimontana82 Feb 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/CI-2x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Build
run: pwsh ./build.ps1 -configuration ${{matrix.configuration}} -targetFrameworks 'all'
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

sonar:
Expand Down Expand Up @@ -87,11 +87,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"DynamicsValue_fake-xrm-easy-core" /o:"dynamicsvalue" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.verbose="true" /d:sonar.qualitygate.wait="true" /d:sonar.cs.opencover.reportsPaths="coverage/**/coverage.opencover.xml" /d:sonar.coverage.exclusions="tests/**/**"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ vars.SONAR_PROJECT_PREFIX }}_fake-xrm-easy-core" /o:"${{ vars.SONAR_ORG_NAME }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.verbose="true" /d:sonar.qualitygate.wait="true" /d:sonar.cs.opencover.reportsPaths="coverage/**/coverage.opencover.xml" /d:sonar.coverage.exclusions="tests/**/**"
.\build.ps1 -configuration FAKE_XRM_EASY_9 -targetFrameworks 'all'
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

Expand All @@ -116,32 +116,32 @@ jobs:
- name: Build
run: pwsh ./build.ps1 -targetFrameworks 'all'
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

- name: Pack Src
run: pwsh ./pack-src.ps1 -targetFrameworks 'all' -versionSuffix "zci.${{ github.head_ref }}${{ github.run_number }}"
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

- name: Push Src
run: nuget.exe push .\nupkgs\FakeXrmEasy.Core.*.nupkg -Source ${{ env.source-url }}
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_AUTH_TOKEN: ${{ github.token }}
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Pack Tests
run: pwsh ./pack-tests.ps1 -targetFrameworks 'all' -versionSuffix "zci.${{ github.head_ref }}${{ github.run_number }}"
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

- name: Push Tests
run: nuget.exe push .\nupkgs\FakeXrmEasy.CoreTests.*.nupkg -Source ${{ env.source-url }}
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_AUTH_TOKEN: ${{ github.token }}
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/CI-3x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Build
run: pwsh ./build.ps1 -configuration ${{matrix.configuration}} -targetFrameworks 'all'
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

sonar:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
testCommand: dotnet test . --configuration 'FAKE_XRM_EASY_9' --framework netcoreapp3.1 --verbosity normal --collect:"XPlat code coverage" --settings tests/.runsettings --results-directory ./coverage
projectKey: ${{ secrets.SONAR_PROJECT_KEY }}
projectName: fake-xrm-easy-core
sonarOrganisation: dynamicsvalue
sonarOrganisation: ${{ vars.SONAR_ORG_NAME }}
beginArguments: >
/d:sonar.verbose="true"
/d:sonar.qualitygate.wait="true"
Expand All @@ -103,7 +103,7 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

pack-push:
Expand All @@ -127,32 +127,32 @@ jobs:
- name: Build
run: pwsh ./build.ps1 -targetFrameworks 'all'
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

- name: Pack Src
run: pwsh ./pack-src.ps1 -targetFrameworks 'all' -versionSuffix "zci.${{ github.head_ref }}${{ github.run_number }}"
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

- name: Push Src
run: nuget.exe push .\nupkgs\FakeXrmEasy.Core.*.nupkg -Source ${{ env.source-url }}
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_AUTH_TOKEN: ${{ github.token }}
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Pack Tests
run: pwsh ./pack-tests.ps1 -targetFrameworks 'all' -versionSuffix "zci.${{ github.head_ref }}${{ github.run_number }}"
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

- name: Push Tests
run: nuget.exe push .\nupkgs\FakeXrmEasy.CoreTests.*.nupkg -Source ${{ env.source-url }}
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_AUTH_TOKEN: ${{ github.token }}
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CI-PullRequest-2x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Build
run: pwsh ./build.ps1 -configuration ${{matrix.configuration}} -targetFramework 'all'
env:
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

sonar:
Expand Down Expand Up @@ -87,11 +87,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
NUGET_USERNAME: DynamicsValue
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"DynamicsValue_fake-xrm-easy-core" /o:"dynamicsvalue" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.verbose="true" /d:sonar.qualitygate.wait="true" /d:sonar.cs.opencover.reportsPaths="coverage/**/coverage.opencover.xml" /d:sonar.coverage.exclusions="tests/**/**"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ vars.SONAR_PROJECT_PREFIX }}_fake-xrm-easy-core" /o:"${{ vars.SONAR_ORG_NAME }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.verbose="true" /d:sonar.qualitygate.wait="true" /d:sonar.cs.opencover.reportsPaths="coverage/**/coverage.opencover.xml" /d:sonar.coverage.exclusions="tests/**/**"
.\build.ps1 -configuration FAKE_XRM_EASY_9 -targetFrameworks 'all'
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-PullRequest-3x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
testCommand: dotnet test . --configuration 'FAKE_XRM_EASY_9' --framework netcoreapp3.1 --verbosity normal --collect:"XPlat code coverage" --settings tests/.runsettings --results-directory ./coverage
projectKey: ${{ secrets.SONAR_PROJECT_KEY }}
projectName: fake-xrm-easy-core
sonarOrganisation: dynamicsvalue
sonarOrganisation: ${{ vars.SONAR_ORG_NAME }}
beginArguments: >
/d:sonar.verbose="true"
/d:sonar.qualitygate.wait="true"
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [2.4.0]

## Added

- **Alpha**: Introduced subscription usage monitoring based on customer feedback

### Changed

- Set default build configuration in solution file to FAKE_XRM_EASY_9
- Remove ReleaseNotes from package description - https://github.com/DynamicsValue/fake-xrm-easy/issues/115
- build.ps1 improvements: do not build project twice (added --no-build) when running dotnet test, do not build again either when packing assemblies either: https://github.com/DynamicsValue/fake-xrm-easy/issues/119
- Update build scripts to use 'all' target frameworks by default - https://github.com/DynamicsValue/fake-xrm-easy/issues/126
- Update github actions to use new Sonar environment variables - https://github.com/DynamicsValue/fake-xrm-easy/issues/120

## [2.3.3]

### Added
Expand Down
12 changes: 6 additions & 6 deletions FakeXrmEasy.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ Global
FAKE_XRM_EASY|x86 = FAKE_XRM_EASY|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|Any CPU.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|Any CPU.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x64.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x64.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x86.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x86.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_2013|Any CPU.ActiveCfg = FAKE_XRM_EASY_2013|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_2013|Any CPU.Build.0 = FAKE_XRM_EASY_2013|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_2013|x64.ActiveCfg = FAKE_XRM_EASY_2013|Any CPU
Expand All @@ -65,12 +71,6 @@ Global
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_365|x64.Build.0 = FAKE_XRM_EASY_365|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_365|x86.ActiveCfg = FAKE_XRM_EASY_365|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_365|x86.Build.0 = FAKE_XRM_EASY_365|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|Any CPU.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|Any CPU.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x64.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x64.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x86.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x86.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY|Any CPU.ActiveCfg = FAKE_XRM_EASY|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY|Any CPU.Build.0 = FAKE_XRM_EASY|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY|x64.ActiveCfg = FAKE_XRM_EASY|Any CPU
Expand Down
9 changes: 6 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param (
[string]$targetFrameworks = "netcoreapp3.1",
[string]$targetFrameworks = "all",
[string]$configuration = "FAKE_XRM_EASY_9",
[string]$packTests = ""
)
Expand Down Expand Up @@ -35,6 +35,7 @@ Write-Host " -> Cleaning..." -ForegroundColor Yellow
./clean.ps1 -folderPath "./tests/FakeXrmEasy.Core.Tests/bin"
./clean.ps1 -folderPath "./tests/FakeXrmEasy.Core.Tests/obj"

Write-Host " -> Restoring dependencies: configuration='$($configuration)', targetFramework='$($targetFrameworks)' PackTests=$($packTests)" -ForegroundColor Yellow
if($targetFrameworks -eq "all")
{
dotnet restore --no-cache --force --force-evaluate /p:Configuration=$configuration /p:PackTests=$packTests --packages $restoredPackagesFolder
Expand All @@ -48,6 +49,7 @@ if(!($LASTEXITCODE -eq 0)) {
throw "Error restoring packages"
}

Write-Host " -> Building: configuration='$($configuration)', targetFramework='$($targetFrameworks)' PackTests=$($packTests)" -ForegroundColor Yellow
if($targetFrameworks -eq "all")
{
dotnet build --configuration $configuration --no-restore /p:PackTests=$packTests
Expand All @@ -61,14 +63,15 @@ if(!($LASTEXITCODE -eq 0)) {
throw "Error during build step"
}

Write-Host " -> Testing: configuration='$($configuration)', targetFramework='$($targetFrameworks)' PackTests=$($packTests)" -ForegroundColor Yellow
if($targetFrameworks -eq "all")
{
dotnet test --configuration $configuration --no-restore --verbosity normal /p:PackTests=$packTests --collect:"XPlat code coverage" --settings tests/.runsettings --results-directory ./coverage
dotnet test --configuration $configuration --no-build --verbosity normal /p:PackTests=$packTests --collect:"XPlat code coverage" --settings tests/.runsettings --results-directory ./coverage

}
else
{
dotnet test --configuration $configuration --no-restore --framework $targetFrameworks --verbosity normal /p:PackTests=$packTests --collect:"XPlat code coverage" --settings tests/.runsettings --results-directory ./coverage
dotnet test --configuration $configuration --no-build --framework $targetFrameworks --verbosity normal /p:PackTests=$packTests --collect:"XPlat code coverage" --settings tests/.runsettings --results-directory ./coverage
}

if(!($LASTEXITCODE -eq 0)) {
Expand Down
8 changes: 4 additions & 4 deletions pack-configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ if($targetFrameworks -eq "all")
{
if($versionSuffix -eq "")
{
dotnet pack --no-build --no-restore --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -o $tempNupkgFolder $projectPath/$projectName.csproj
dotnet pack --no-build --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -o $tempNupkgFolder $projectPath/$projectName.csproj
}
else {
dotnet pack --no-build --no-restore --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -o $tempNupkgFolder $projectPath/$projectName.csproj --version-suffix $versionSuffix
dotnet pack --no-build --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -o $tempNupkgFolder $projectPath/$projectName.csproj --version-suffix $versionSuffix
}
}
else
{
if($versionSuffix -eq "")
{
dotnet pack --no-build --no-restore --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -p:TargetFrameworks=$targetFrameworks -o $tempNupkgFolder $projectPath/$projectName.csproj
dotnet pack --no-build --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -p:TargetFrameworks=$targetFrameworks -o $tempNupkgFolder $projectPath/$projectName.csproj
}
else {
dotnet pack --no-build --no-restore --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -p:TargetFrameworks=$targetFrameworks -o $tempNupkgFolder $projectPath/$projectName.csproj --version-suffix $versionSuffix
dotnet pack --no-build --configuration $configuration -p:PackageID=$packageId -p:Title=$packageId -p:PackTests=$packTests -p:TargetFrameworks=$targetFrameworks -o $tempNupkgFolder $projectPath/$projectName.csproj --version-suffix $versionSuffix
}
}

Expand Down
17 changes: 17 additions & 0 deletions src/FakeXrmEasy.Core/CommercialLicense/EnvironmentReader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace FakeXrmEasy.Core.CommercialLicense
{
internal interface IEnvironmentReader
{
string GetEnvironmentVariable(string variableName);
}

internal class EnvironmentReader: IEnvironmentReader
{
public string GetEnvironmentVariable(string variableName)
{
return Environment.GetEnvironmentVariable(variableName);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;

namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
{
/// <summary>
/// Exception raised when the current number of users calculated based on the usage of your current subscription is greater than the maximum number of users in your current subscription
/// </summary>
public class ConsiderUpgradingPlanException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
/// <param name="currentNumberOfUsers"></param>
/// <param name="allowedNumberOfUsers"></param>
public ConsiderUpgradingPlanException(long currentNumberOfUsers, long allowedNumberOfUsers) :
base($"Your current subscription allows up to {allowedNumberOfUsers.ToString()}, however, {currentNumberOfUsers.ToString()} are currently using it. Please consider upgrading your current plan.")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
{
/// <summary>
/// Exception raised when the license key is invalid or malformed
/// </summary>
public class InvalidLicenseKeyException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public InvalidLicenseKeyException() : base("The license key is invalid")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
{
/// <summary>
/// Exception thrown if the info about the current subscription plan is unknown
/// </summary>
public class NoSubscriptionPlanInfoException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public NoSubscriptionPlanInfoException() : base("The current subscription info is unknown")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
{
/// <summary>
/// Throws an exception when your current usage of FakeXrmEasy could not be retrieved
/// </summary>
public class NoUsageFoundException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public NoUsageFoundException() : base("No info about your current usage of FakeXrmEasy was found")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;

namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
{
/// <summary>
/// Exception raised when your current subscription expired and you exceeded the allowed renewal time window
/// </summary>
public class RenewalRequestExpiredException: Exception
{
/// <summary>
/// Throws an exception where the current subscription expired
/// </summary>
/// <param name="expiredOn"></param>
public RenewalRequestExpiredException(DateTime expiredOn) : base($"The current subscription expired on '{expiredOn.ToLongDateString()}' and a renewal license was not applied on time. Please request a new subscription license.")
{

}
}
}
Loading
Loading