-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
red: Repackaging.DoesNotRecreatePackage
- Loading branch information
Showing
3 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.FileSystemGlobbing; | ||
using MinVerTests.Infra; | ||
using Xunit; | ||
|
||
namespace MinVerTests.Packages | ||
{ | ||
public static class Cleaning | ||
{ | ||
[Theory] | ||
[InlineData(false)] | ||
[InlineData(true)] | ||
public static async Task PackagesAreCleaned(bool multiTarget) | ||
{ | ||
// arrange | ||
var path = MethodBase.GetCurrentMethod().GetTestDirectory(tag: multiTarget); | ||
await Sdk.CreateProject(path, multiTarget: multiTarget); | ||
|
||
await Git.Init(path); | ||
await Git.Commit(path); | ||
await Git.Tag(path, "2.3.4"); | ||
|
||
_ = await Sdk.BuildProject(path); | ||
|
||
var packages = new Matcher().AddInclude("**/bin/Debug/*.nupkg"); | ||
Assert.NotEmpty(packages.GetResultsInFullPath(path)); | ||
|
||
// act | ||
_ = await Sdk.DotNet("clean", path, new Dictionary<string, string> { { "GeneratePackageOnBuild", "true" } }); | ||
|
||
// assert | ||
Assert.Empty(packages.GetResultsInFullPath(path)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
using MinVerTests.Infra; | ||
using Xunit; | ||
|
||
namespace MinVerTests.Packages | ||
{ | ||
public static class Repackaging | ||
{ | ||
[Theory] | ||
[InlineData(false)] | ||
[InlineData(true)] | ||
public static async Task DoesNotRecreatePackage(bool multiTarget) | ||
{ | ||
// arrange | ||
var path = MethodBase.GetCurrentMethod().GetTestDirectory(tag: multiTarget); | ||
await Sdk.CreateProject(path, multiTarget: multiTarget); | ||
|
||
await Git.Init(path); | ||
await Git.Commit(path); | ||
await Git.Tag(path, "2.3.4"); | ||
|
||
var (_, result) = await Sdk.BuildProject(path); | ||
|
||
Assert.Contains("Successfully created package", result.StandardOutput, StringComparison.OrdinalIgnoreCase); | ||
|
||
// act | ||
result = await Sdk.Pack(path); | ||
|
||
// assert | ||
Assert.DoesNotContain("Successfully created package", result.StandardOutput, StringComparison.OrdinalIgnoreCase); | ||
} | ||
} | ||
} |