diff --git a/AspNetCoreSdkTests/AspNetCoreSdkTests.csproj b/AspNetCoreSdkTests/AspNetCoreSdkTests.csproj index 8227ab5864..45b505c8d3 100644 --- a/AspNetCoreSdkTests/AspNetCoreSdkTests.csproj +++ b/AspNetCoreSdkTests/AspNetCoreSdkTests.csproj @@ -10,7 +10,8 @@ - + + diff --git a/AspNetCoreSdkTests/RuntimeIdentifier.cs b/AspNetCoreSdkTests/RuntimeIdentifier.cs index a0898b1968..84c31b3c99 100644 --- a/AspNetCoreSdkTests/RuntimeIdentifier.cs +++ b/AspNetCoreSdkTests/RuntimeIdentifier.cs @@ -15,18 +15,21 @@ namespace AspNetCoreSdkTests public static RuntimeIdentifier Linux_x64 = new RuntimeIdentifier() { Name = "linux-x64", OSPlatforms = new[] { OSPlatform.Linux, }, + ExecutableFileExtension = string.Empty, }; public static RuntimeIdentifier OSX_x64 = new RuntimeIdentifier() { Name = "osx-x64", OSPlatforms = new[] { OSPlatform.OSX, }, + ExecutableFileExtension = string.Empty, }; public static RuntimeIdentifier Win_x64 = new RuntimeIdentifier() { Name = "win-x64", OSPlatforms = new[] { OSPlatform.Windows, }, + ExecutableFileExtension = ".exe", }; public static IEnumerable All = new[] @@ -43,6 +46,7 @@ namespace AspNetCoreSdkTests public string RuntimeArgument => (this == None) ? string.Empty : $"--runtime {Name}"; public string Path => (this == None) ? string.Empty : Name; public IEnumerable OSPlatforms { get; private set; } + public string ExecutableFileExtension { get; private set; } public override string ToString() => Name; } diff --git a/AspNetCoreSdkTests/TemplateTests.cs b/AspNetCoreSdkTests/TemplateTests.cs index 8abeda0de6..eea9f217ea 100644 --- a/AspNetCoreSdkTests/TemplateTests.cs +++ b/AspNetCoreSdkTests/TemplateTests.cs @@ -1,5 +1,6 @@ using AspNetCoreSdkTests.Templates; using AspNetCoreSdkTests.Util; +using NuGet.Versioning; using NUnit.Framework; using System; using System.Collections.Generic; @@ -19,6 +20,13 @@ namespace AspNetCoreSdkTests CollectionAssert.AreEquivalent(template.ExpectedObjFilesAfterRestore, template.ObjFilesAfterRestore); } + [Test] + [TestCaseSource(nameof(RestoreData))] + public void RestoreIncremental(Template template) + { + CollectionAssert.AreEquivalent(template.ExpectedObjFilesAfterRestore, template.ObjFilesAfterRestoreIncremental); + } + [Test] [TestCaseSource(nameof(BuildData))] public void Build(Template template) @@ -27,11 +35,30 @@ namespace AspNetCoreSdkTests CollectionAssert.AreEquivalent(template.ExpectedBinFilesAfterBuild, template.BinFilesAfterBuild); } + [Test] + [TestCaseSource(nameof(BuildData))] + public void BuildIncremental(Template template) + { + CollectionAssert.AreEquivalent(template.ExpectedObjFilesAfterBuild, template.ObjFilesAfterBuildIncremental); + CollectionAssert.AreEquivalent(template.ExpectedBinFilesAfterBuild, template.BinFilesAfterBuildIncremental); + } + [Test] [TestCaseSource(nameof(PublishData))] public void Publish(Template template) { - CollectionAssert.AreEquivalent(template.ExpectedFilesAfterPublish, template.FilesAfterPublish); + var expected = template.ExpectedFilesAfterPublish; + var actual = template.FilesAfterPublish; + CollectionAssert.AreEquivalent(expected, actual); + } + + [Test] + [TestCaseSource(nameof(PublishData))] + public void PublishIncremental(Template template) + { + var expected = template.ExpectedFilesAfterPublish; + var actual = template.FilesAfterPublishIncremental; + CollectionAssert.AreEquivalent(expected, actual); } [Test] @@ -85,11 +112,11 @@ namespace AspNetCoreSdkTests private static IEnumerable