dotnet-installer/test/dotnet-build.Tests/IncrementalTestsVersionSuffix.cs
Andrew Stanton-Nurse d5b1ee138f Add version suffix to build cache to ensure incremental builds are reset when it changes (#3246)
* add test for #2687
* fix #2687 by writing version suffix to build cache
2016-05-27 10:49:50 -07:00

29 lines
1 KiB
C#

using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
namespace Microsoft.DotNet.Tools.Builder.Tests
{
public class IncrementalTestsVersionSuffix : IncrementalTestBase
{
[Fact]
public void TestRebuildWhenVersionSuffixChanged()
{
var testInstance = TestAssetsManager.CreateTestInstance("TestSimpleIncrementalApp")
.WithLockFiles();
// Build with Version Suffix 1
var command = new BuildCommand(testInstance.TestRoot, versionSuffix: "1");
var result = command.ExecuteWithCapturedOutput();
// Verify the result
result.Should().HaveCompiledProject("TestSimpleIncrementalApp", ".NETCoreApp,Version=v1.0");
// Build with Version Suffix 2
command = new BuildCommand(testInstance.TestRoot, versionSuffix: "2");
result = command.ExecuteWithCapturedOutput();
// Verify the result
result.Should().HaveCompiledProject("TestSimpleIncrementalApp", ".NETCoreApp,Version=v1.0");
}
}
}