From 10cfa744e568d34ad60506e00e828e2eac786f53 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Mon, 1 Aug 2016 15:02:22 -0500 Subject: [PATCH] PR feedback. Implement VersionPrefix and VersionSuffix MSBuild properties. Use FluentAssertions in the test. --- src/dotnet/Microsoft.DotNet.Core.Sdk.targets | 5 ++++- .../GivenADependencyContextBuilder.cs | 6 ++++-- test/Microsoft.DotNet.Core.Build.Tasks.Tests/project.json | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dotnet/Microsoft.DotNet.Core.Sdk.targets b/src/dotnet/Microsoft.DotNet.Core.Sdk.targets index 811e7745f..35f0961d5 100644 --- a/src/dotnet/Microsoft.DotNet.Core.Sdk.targets +++ b/src/dotnet/Microsoft.DotNet.Core.Sdk.targets @@ -20,7 +20,10 @@ true - 1.0.0 + 1.0.0 + + $(VersionPrefix)-$(VersionSuffix) + $(VersionPrefix) diff --git a/test/Microsoft.DotNet.Core.Build.Tasks.Tests/GivenADependencyContextBuilder.cs b/test/Microsoft.DotNet.Core.Build.Tasks.Tests/GivenADependencyContextBuilder.cs index a2e83f519..1278347c2 100644 --- a/test/Microsoft.DotNet.Core.Build.Tasks.Tests/GivenADependencyContextBuilder.cs +++ b/test/Microsoft.DotNet.Core.Build.Tasks.Tests/GivenADependencyContextBuilder.cs @@ -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) diff --git a/test/Microsoft.DotNet.Core.Build.Tasks.Tests/project.json b/test/Microsoft.DotNet.Core.Build.Tasks.Tests/project.json index 804f8c5bb..6248490de 100644 --- a/test/Microsoft.DotNet.Core.Build.Tasks.Tests/project.json +++ b/test/Microsoft.DotNet.Core.Build.Tasks.Tests/project.json @@ -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",