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 #68

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.4.2]

### Added

- Added link to docs in exceptions
- Added some logging in subscription usage for CI builds

## [2.4.1]

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
/// </summary>
public class ConsiderUpgradingPlanException: Exception
{
private const string _url =
CommercialLicenseTroubleshootingLinks.BaseUrl + "/consider-upgrading-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.")
base($"Your current subscription allows up to {allowedNumberOfUsers.ToString()} users, however, {currentNumberOfUsers.ToString()} users are currently using it. Please consider upgrading your current plan. More info at {_url}.")
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
/// </summary>
public class InvalidLicenseKeyException: Exception
{
private const string _url =
CommercialLicenseTroubleshootingLinks.BaseUrl + "/invalid-license-key-exception/";

/// <summary>
/// Default constructor
/// </summary>
public InvalidLicenseKeyException() : base("The license key is invalid")
public InvalidLicenseKeyException() : base($"The license key is invalid. More info at {_url}.")
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
/// </summary>
public class NoSubscriptionPlanInfoException: Exception
{
private const string _url =
CommercialLicenseTroubleshootingLinks.BaseUrl + "/no-subscription-plan-info-exception/";

/// <summary>
/// Default constructor
/// </summary>
public NoSubscriptionPlanInfoException() : base("The current subscription info is unknown")
public NoSubscriptionPlanInfoException() : base($"The current subscription info is unknown. More info at {_url}.")
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
/// </summary>
public class NoUsageFoundException: Exception
{
private const string _url =
CommercialLicenseTroubleshootingLinks.BaseUrl + "/no-usage-found-exception/";

/// <summary>
/// Default constructor
/// </summary>
public NoUsageFoundException() : base("No info about your current usage of FakeXrmEasy was found")
public NoUsageFoundException() : base($"No info about your current usage of FakeXrmEasy was found. More info at {_url}.")
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
/// </summary>
public class RenewalRequestExpiredException: Exception
{
private const string _url =
CommercialLicenseTroubleshootingLinks.BaseUrl + "/renewal-request-expired-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.")
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. More info at {_url}.")
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
/// </summary>
public class SubscriptionExpiredException: Exception
{
private const string _url =
CommercialLicenseTroubleshootingLinks.BaseUrl + "/subscription-expired-exception/";

/// <summary>
/// Throws an exception where the current subscription expired
/// </summary>
/// <param name="expiredOn"></param>
public SubscriptionExpiredException(DateTime expiredOn) : base($"The current subscription expired on {expiredOn.ToLongDateString()}")
public SubscriptionExpiredException(DateTime expiredOn) : base($"The current subscription expired on {expiredOn.ToLongDateString()}. More info at {_url}.")
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
namespace FakeXrmEasy.Core.CommercialLicense.Exceptions
{
/// <summary>
/// Exception raised when the grace period for requesting an upgrade has expired
/// Exception raised when the grace period for requesting an upgrade has expired: https://dynamicsvalue.github.io/fake-xrm-easy-docs/licensing/commercial-license/troubleshooting/upgrade-request-expired-exception/
/// </summary>
public class UpgradeRequestExpiredException: Exception
{
private const string _url =
CommercialLicenseTroubleshootingLinks.BaseUrl + "/upgrade-request-expired-exception/";

/// <summary>
/// Default constructor
/// </summary>
/// <param name="firstRequested"></param>
public UpgradeRequestExpiredException(DateTime firstRequested) :
base($"You requested a subscription upgrade on '{firstRequested.ToShortDateString()}', however, the new subscription details or upgrade progress has not been completed within the allowed upgrade window. Please contact your line manager and raise a support ticket")
base($"You requested a subscription upgrade on '{firstRequested.ToShortDateString()}', however, the new subscription details or upgrade progress has not been completed within the allowed upgrade window. More info at {_url}.")
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ internal void SetSubscriptionStorageProvider_Internal(ISubscriptionStorageProvid
{
if (_environmentReader.IsRunningInContinuousIntegration())
{
Console.WriteLine("Running in CI... skipping usage.");
_subscriptionUsage = new SubscriptionUsage();
return;
}
Expand Down
12 changes: 12 additions & 0 deletions src/FakeXrmEasy.Core/DocsLinks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace FakeXrmEasy
{
internal static class DocLinks
{
internal const string BaseUrl = "https://dynamicsvalue.github.io/fake-xrm-easy-docs";
}

internal static class CommercialLicenseTroubleshootingLinks
{
internal const string BaseUrl = DocLinks.BaseUrl + "/licensing/commercial-license/troubleshooting";
}
}
2 changes: 1 addition & 1 deletion src/FakeXrmEasy.Core/FakeXrmEasy.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<TargetFrameworks Condition="'$(Configuration)'=='FAKE_XRM_EASY_2013'">net452</TargetFrameworks>
<TargetFrameworks Condition="'$(Configuration)'=='FAKE_XRM_EASY'">net452</TargetFrameworks>
<PackageId>FakeXrmEasy.Core</PackageId>
<VersionPrefix>2.4.1</VersionPrefix>
<VersionPrefix>2.4.2</VersionPrefix>
<Authors>Jordi Montaña</Authors>
<Company>Dynamics Value</Company>
<Title>FakeXrmEasy Core</Title>
Expand Down
14 changes: 7 additions & 7 deletions tests/FakeXrmEasy.Core.Tests/FakeXrmEasy.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<IsPackable>true</IsPackable>

<PackageId>FakeXrmEasy.CoreTests</PackageId>
<VersionPrefix>2.4.1</VersionPrefix>
<VersionPrefix>2.4.2</VersionPrefix>
<Authors>Jordi Montaña</Authors>
<Company>Dynamics Value S.L.</Company>
<Title>Internal Unit test suite for FakeXrmEasy.Core package</Title>
Expand Down Expand Up @@ -137,22 +137,22 @@
</ItemGroup>

<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY'">
<PackageReference Include="FakeXrmEasy.Core.v2011" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2011" Version="[2.4.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2013'">
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="[2.4.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="[2.4.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="[2.4.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="FakeXrmEasy.Core.v365" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v365" Version="[2.4.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="FakeXrmEasy.Core.v9" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="[2.4.2-*,3.0)" />
</ItemGroup>


Expand Down
Loading