Skip to content

Commit

Permalink
addressing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kartheekp-ms committed Mar 9, 2020
1 parent c1165e2 commit 42fc69c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace NuGet.Packaging.CrossVerify.Generate.Test
public class GenerateSignedPackages
{
private readonly GenerateFixture _generateFixture;
private string _directoryPath;
private readonly string _directoryPath;

private readonly SigningTestFixture _signingTestFixture_Author;
private readonly TrustedTestCert<TestCertificate> _authorSignningCert;
Expand Down Expand Up @@ -396,6 +396,8 @@ public async Task PreGenerateSignedPackages_AuthorSigned_TimeStampedWithNoSignin
nupkg,
packagePath,
timestampService.Url);

Assert.True(File.Exists(signedPackagePath));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public async Task VerifySignaturesAsync_PreGenerateSignedPackages_AuthorSigned_T
string caseName = TestPackages.Package1.ToString();

var signedPackageFolder = Path.Combine(dir, caseName, "package");
var signedPackagePath = TestFileSystemUtility.GetFirstFileName(signedPackageFolder, "*.nupkg");
var signedPackagePath = TestFileSystemUtility.GetFirstFileNameOrNull(signedPackageFolder, "*.nupkg");

using (FileStream stream = File.OpenRead(signedPackagePath))
using (var reader = new PackageArchiveReader(stream))
Expand Down
6 changes: 0 additions & 6 deletions test/TestUtilities/Test.Utility/Signing/TestPackages.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test.Utility.Signing
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion test/TestUtilities/Test.Utility/TestFileSystemUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private static DirectoryInfo GetRepositoryRoot(DirectoryInfo currentDir)
/// <param name="path"></param>
/// <param name="searchPattern"><see cref="System.IO.Directory.EnumerateFiles(string, string)"/></param>
/// <returns></returns>
public static string GetFirstFileName(string path, string searchPattern)
public static string GetFirstFileNameOrNull(string path, string searchPattern)
{
IEnumerable<string> files = Directory.EnumerateFiles(path, searchPattern);

Expand Down

0 comments on commit 42fc69c

Please sign in to comment.