Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
2 changes: 1 addition & 1 deletion src/NuSeal/Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace NuSeal;

internal class Assets
{
private const string TASK_NAME = nameof(ValidateLicenseTask);
private const string TASK_NAME = nameof(ValidateLicenseTask_0_4_0);

public static string GenerateProps(ConsumerParameters parameters)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace NuSeal;

public partial class ValidateLicenseTask : Task
public partial class ValidateLicenseTask_0_4_0 : Task
{
public string MainAssemblyPath { get; set; } = "";
public string ProtectedPackageId { get; set; } = "";
Expand All @@ -26,7 +26,7 @@ public override bool Execute()
{
// This should never happen as we always pass all arguments while preparing assets for authors.
// If that's the case, something went really wrong, and we won't break end users' builds.
Log.LogMessage(MessageImportance.High, "NuSeal: Invalid arguments for {0}", nameof(ValidateLicenseTask));
Log.LogMessage(MessageImportance.High, "NuSeal: Invalid arguments for {0}", nameof(ValidateLicenseTask_0_4_0));
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/NuSeal.Tests/AssetsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void GenerateProps_ReturnUniqueAsset()
</ItemGroup>

<UsingTask
TaskName="NuSeal.ValidateLicenseTask"
TaskName="NuSeal.ValidateLicenseTask_0_4_0"
AssemblyFile="$(NuSealAssembly_PrefixPackageId1)"
TaskFactory="TaskHostFactory" />

Expand Down Expand Up @@ -93,7 +93,7 @@ public void GenerateTargets_ReturnUniqueAssetWithNoCondition_GivenDirectScope()
AfterTargets="AfterBuild"
>

<NuSeal.ValidateLicenseTask
<NuSeal.ValidateLicenseTask_0_4_0
MainAssemblyPath="$(TargetPath)"
ProtectedPackageId="Prefix.PackageId1"
ProtectedAssemblyName="Assembly1"
Expand Down Expand Up @@ -135,7 +135,7 @@ public void GenerateTargets_ReturnUniqueAssetWithCondition_GivenTransitiveScope(
AfterTargets="AfterBuild"
Condition="'$(OutputType)' == 'Exe' Or '$(OutputType)' == 'WinExe' Or '$(MSBuildProjectSdk)' == 'Microsoft.NET.Sdk.Web'">

<NuSeal.ValidateLicenseTask
<NuSeal.ValidateLicenseTask_0_4_0
MainAssemblyPath="$(TargetPath)"
ProtectedPackageId="Prefix.PackageId1"
ProtectedAssemblyName="Assembly1"
Expand Down
4 changes: 2 additions & 2 deletions tests/NuSeal.Tests/ConsumerParametersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public void Constructor_SetsDefaultOptions_GivenNull()
{
var parameters = new ConsumerParameters(
"path/to/assets",
"1.0.0",
"1.0.0",
"path/to/output",
"Package.Id",
"Assembly",
Expand All @@ -28,7 +28,7 @@ public void Constructor_HandlesNullPropsAndTargetsFiles()
var parameters = new ConsumerParameters(
"path/to/assets",
"1.0.0",
"path/to/output",
"path/to/output",
"Package.Id",
"Assembly",
Array.Empty<PemData>(),
Expand Down
4 changes: 2 additions & 2 deletions tests/NuSeal.Tests/GenerateConsumerAssetsTaskTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void ReturnTrueAndGeneratesAssets()
</ItemGroup>

<UsingTask
TaskName="NuSeal.ValidateLicenseTask"
TaskName="NuSeal.ValidateLicenseTask_0_4_0"
AssemblyFile="$(NuSealAssembly_PrefixPackageId1)"
TaskFactory="TaskHostFactory" />

Expand All @@ -268,7 +268,7 @@ public void ReturnTrueAndGeneratesAssets()
AfterTargets="AfterBuild"
Condition="'$(OutputType)' == 'Exe' Or '$(OutputType)' == 'WinExe' Or '$(MSBuildProjectSdk)' == 'Microsoft.NET.Sdk.Web'">

<NuSeal.ValidateLicenseTask
<NuSeal.ValidateLicenseTask_0_4_0
MainAssemblyPath="$(TargetPath)"
ProtectedPackageId="Prefix.PackageId1"
ProtectedAssemblyName="Assembly1"
Expand Down
3 changes: 1 addition & 2 deletions tests/NuSeal.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
global using FluentAssertions;
global using System.Linq.Expressions;
global using Xunit;
global using NuSeal;
global using Xunit;
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

namespace Tests;

public class ValidateLicenseTaskTests : IDisposable
public class ValidateLicenseTaskTests_0_4_0 : IDisposable
{
private readonly RsaPemPair _rsaPemPair;
private readonly TestBuildEngine _buildEngine;
private readonly string _tempDir;
private readonly string _mainAssemblyPath;

public ValidateLicenseTaskTests()
public ValidateLicenseTaskTests_0_4_0()
{
_rsaPemPair = RsaKeyGenerator.GeneratePem();
_buildEngine = new TestBuildEngine();
Expand All @@ -26,7 +26,7 @@ public void ReturnsTrue_GivenValidLicenseAndDirectScope()
var productName = "TestProduct";
CreateValidLicense(productName);

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand All @@ -51,7 +51,7 @@ public void ReturnsTrue_GivenValidLicenseAndTransitiveScope()
var productName = "TestProduct";
CreateValidLicense(productName);

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand All @@ -75,7 +75,7 @@ public void ReturnsTrue_LogsWarning_GivenNoLicenseAndWarningMode()
{
var productName = "TestProduct";

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand All @@ -99,7 +99,7 @@ public void ReturnsFalse_LogsError_GivenNoLicenseAndErrorMode()
{
var productName = "TestProduct";

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand All @@ -124,7 +124,7 @@ public void ReturnsTrue_LogsInfo_GivenNoPems()
var productName = "TestProduct";
CreateValidLicense(productName);

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand Down Expand Up @@ -158,7 +158,7 @@ public void ReturnsTrue_LogsWarning_GivenWarningMode_ExpiredWithinGracePeriodLic

CreateLicense(licenseParameters);

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand Down Expand Up @@ -192,7 +192,7 @@ public void ReturnsTrue_LogsWarning_GivenErrorMode_ExpiredWithinGracePeriodLicen

CreateLicense(licenseParameters);

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand Down Expand Up @@ -226,7 +226,7 @@ public void ReturnsTrue_LogsWarning_GivenWarningMode_ExpiredOutsideGracePeriodLi

CreateLicense(licenseParameters);

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand Down Expand Up @@ -260,7 +260,7 @@ public void ReturnsFalse_LogsError_GivenErrorMode_ExpiredOutsideGracePeriodLicen

CreateLicense(licenseParameters);

var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = _mainAssemblyPath,
Expand All @@ -282,7 +282,7 @@ public void ReturnsFalse_LogsError_GivenErrorMode_ExpiredOutsideGracePeriodLicen
[Fact]
public void ReturnsTrue_LogsInfo_GivenNullMainAssemblyPath()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = null!,
Expand All @@ -304,7 +304,7 @@ public void ReturnsTrue_LogsInfo_GivenNullMainAssemblyPath()
[Fact]
public void ReturnsTrue_LogsInfo_GivenEmptyMainAssemblyPath()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "",
Expand All @@ -326,7 +326,7 @@ public void ReturnsTrue_LogsInfo_GivenEmptyMainAssemblyPath()
[Fact]
public void ReturnsTrue_LogsInfo_GivenWhitespaceMainAssemblyPath()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = " ",
Expand All @@ -348,7 +348,7 @@ public void ReturnsTrue_LogsInfo_GivenWhitespaceMainAssemblyPath()
[Fact]
public void ReturnsTrue_LogsInfo_GivenNullProtectedPackageId()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -370,7 +370,7 @@ public void ReturnsTrue_LogsInfo_GivenNullProtectedPackageId()
[Fact]
public void ReturnsTrue_LogsInfo_GivenEmptyProtectedPackageId()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -392,7 +392,7 @@ public void ReturnsTrue_LogsInfo_GivenEmptyProtectedPackageId()
[Fact]
public void ReturnsTrue_LogsInfo_GivenWhitespaceProtectedPackageId()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -414,7 +414,7 @@ public void ReturnsTrue_LogsInfo_GivenWhitespaceProtectedPackageId()
[Fact]
public void ReturnsTrue_LogsInfo_GivenNullProtectedAssemblyName()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -436,7 +436,7 @@ public void ReturnsTrue_LogsInfo_GivenNullProtectedAssemblyName()
[Fact]
public void ReturnsTrue_LogsInfo_GivenEmptyProtectedAssemblyName()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -458,7 +458,7 @@ public void ReturnsTrue_LogsInfo_GivenEmptyProtectedAssemblyName()
[Fact]
public void ReturnsTrue_LogsInfo_GivenWhitespaceProtectedAssemblyName()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -480,7 +480,7 @@ public void ReturnsTrue_LogsInfo_GivenWhitespaceProtectedAssemblyName()
[Fact]
public void ReturnsTrue_LogsInfo_GivenNullPems()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -502,7 +502,7 @@ public void ReturnsTrue_LogsInfo_GivenNullPems()
[Fact]
public void ReturnsTrue_LogsInfo_GivenEmptyPems()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -524,7 +524,7 @@ public void ReturnsTrue_LogsInfo_GivenEmptyPems()
[Fact]
public void ReturnsTrue_LogsInfo_GivenNullValidationMode()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -546,7 +546,7 @@ public void ReturnsTrue_LogsInfo_GivenNullValidationMode()
[Fact]
public void ReturnsTrue_LogsInfo_GivenEmptyValidationMode()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -568,7 +568,7 @@ public void ReturnsTrue_LogsInfo_GivenEmptyValidationMode()
[Fact]
public void ReturnsTrue_LogsInfo_GivenWhitespaceValidationMode()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -590,7 +590,7 @@ public void ReturnsTrue_LogsInfo_GivenWhitespaceValidationMode()
[Fact]
public void ReturnsTrue_LogsInfo_GivenNullValidationScope()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -612,7 +612,7 @@ public void ReturnsTrue_LogsInfo_GivenNullValidationScope()
[Fact]
public void ReturnsTrue_LogsInfo_GivenEmptyValidationScope()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand All @@ -634,7 +634,7 @@ public void ReturnsTrue_LogsInfo_GivenEmptyValidationScope()
[Fact]
public void ReturnsTrue_LogsInfo_GivenWhitespaceValidationScope()
{
var task = new ValidateLicenseTask
var task = new ValidateLicenseTask_0_4_0
{
BuildEngine = _buildEngine,
MainAssemblyPath = "x",
Expand Down