PR feedback.

Implement VersionPrefix and VersionSuffix MSBuild properties.

Use FluentAssertions in the test.
This commit is contained in:
Eric Erhardt 2016-08-01 15:02:22 -05:00
parent a4aa0a99cd
commit 10cfa744e5
3 changed files with 9 additions and 3 deletions

View file

@ -20,7 +20,10 @@
<PropertyGroup> <PropertyGroup>
<GenerateRuntimeConfigurationFiles Condition=" '$(GenerateRuntimeConfigurationFiles)' == '' and '$(OutputType)' == 'exe' ">true</GenerateRuntimeConfigurationFiles> <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> </PropertyGroup>
<UsingTask TaskName="GenerateDepsFile" AssemblyFile="$(MicrosoftDotNetCoreBuildTasksDirectory)Microsoft.DotNet.Core.Build.Tasks.dll" /> <UsingTask TaskName="GenerateDepsFile" AssemblyFile="$(MicrosoftDotNetCoreBuildTasksDirectory)Microsoft.DotNet.Core.Build.Tasks.dll" />

View file

@ -1,8 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO; using System.IO;
using FluentAssertions.Json;
using Microsoft.Extensions.DependencyModel; using Microsoft.Extensions.DependencyModel;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -36,7 +36,9 @@ namespace Microsoft.DotNet.Core.Build.Tasks.Tests
JObject result = Save(dependencyContext); JObject result = Save(dependencyContext);
JObject baseline = ReadJson($"{mainProjectName}.deps.json"); 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) private static JObject ReadJson(string path)

View file

@ -12,6 +12,7 @@
"target": "project" "target": "project"
}, },
"xunit": "2.1.0", "xunit": "2.1.0",
"FluentAssertions.Json": "4.12.0",
"dotnet-test-xunit": "1.0.0-rc2-192208-24" "dotnet-test-xunit": "1.0.0-rc2-192208-24"
}, },
"testRunner": "xunit", "testRunner": "xunit",