Skip to content

Commit

Permalink
verify mstest nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Oct 2, 2024
1 parent 4d9b9a6 commit f4b968e
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Verify.MSTest.Tests/Tests.Nuget.verified.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
_rels/.rels,
Verify.MSTest.nuspec,
lib/net472/Verify.MSTest.dll,
lib/net472/Verify.MSTest.xml,
lib/net48/Verify.MSTest.dll,
lib/net48/Verify.MSTest.xml,
lib/net6.0/Verify.MSTest.dll,
lib/net6.0/Verify.MSTest.xml,
lib/net8.0/Verify.MSTest.dll,
lib/net8.0/Verify.MSTest.xml,
lib/net9.0/Verify.MSTest.dll,
lib/net9.0/Verify.MSTest.xml,
analyzers/dotnet/roslyn4.4/cs/Verify.MSTest.SourceGenerator.dll,
analyzers/dotnet/roslyn4.4/cs/Verify.MSTest.SourceGenerator.xml,
icon.png,
buildTransitive/Verify.MSTest.props,
build/Verify.MSTest.props,
[Content_Types].xml
]
32 changes: 32 additions & 0 deletions src/Verify.MSTest.Tests/Tests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident

#if RELEASE && NET9_0
using System.IO.Compression;
#endif

[TestClass]
public partial class Tests
{
Expand Down Expand Up @@ -40,6 +45,33 @@ public Task UseTextForParameters(string arg) =>
public Task StringTarget() =>
Verify(new Target("txt", "Value"));

#if RELEASE && NET9_0

[TestMethod]
public Task Nuget()
{
var nugetDirectory = Path.Combine(AttributeReader.GetSolutionDirectory(), "../nugets/");
var nugetPath = Directory.EnumerateFiles(nugetDirectory, "Verify.MSTest.*.nupkg")
.OrderBy(File.GetCreationTime)
.First();
using var stream = File.OpenRead(nugetPath);
using var archive = new ZipArchive(stream, ZipArchiveMode.Read);

var paths = new List<string>();

foreach (var entry in archive.Entries)
{
if (!entry.FullName.EndsWith("psmdcp"))
{
paths.Add(entry.FullName);
}
}

return Verify(paths);
}

#endif

[ResultFilesCallback]
[TestMethod]
public async Task ChangeHasAttachment()
Expand Down

0 comments on commit f4b968e

Please sign in to comment.