PR feedback.
Implement VersionPrefix and VersionSuffix MSBuild properties. Use FluentAssertions in the test.
This commit is contained in:
parent
a4aa0a99cd
commit
10cfa744e5
3 changed files with 9 additions and 3 deletions
|
@ -20,7 +20,10 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<GenerateRuntimeConfigurationFiles Condition=" '$(GenerateRuntimeConfigurationFiles)' == '' and '$(OutputType)' == 'exe' ">true</GenerateRuntimeConfigurationFiles>
|
||||
<Version Condition=" '$(Version)' == '' ">1.0.0</Version>
|
||||
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">1.0.0</VersionPrefix>
|
||||
<VersionSuffix Condition=" '$(VersionSuffix)' == '' "></VersionSuffix>
|
||||
<Version Condition=" '$(Version)' == '' and '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
|
||||
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<UsingTask TaskName="GenerateDepsFile" AssemblyFile="$(MicrosoftDotNetCoreBuildTasksDirectory)Microsoft.DotNet.Core.Build.Tasks.dll" />
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using FluentAssertions.Json;
|
||||
using Microsoft.Extensions.DependencyModel;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
@ -36,7 +36,9 @@ namespace Microsoft.DotNet.Core.Build.Tasks.Tests
|
|||
JObject result = Save(dependencyContext);
|
||||
JObject baseline = ReadJson($"{mainProjectName}.deps.json");
|
||||
|
||||
Assert.True(JToken.DeepEquals(baseline, result), $"Expected: {baseline}{Environment.NewLine}Result: {result}");
|
||||
baseline
|
||||
.Should()
|
||||
.BeEquivalentTo(result);
|
||||
}
|
||||
|
||||
private static JObject ReadJson(string path)
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"target": "project"
|
||||
},
|
||||
"xunit": "2.1.0",
|
||||
"FluentAssertions.Json": "4.12.0",
|
||||
"dotnet-test-xunit": "1.0.0-rc2-192208-24"
|
||||
},
|
||||
"testRunner": "xunit",
|
||||
|
|
Loading…
Reference in a new issue