diff --git a/Directory.Packages.props b/Directory.Packages.props
index eca68c8c53b..0d372dfc926 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -10,6 +10,7 @@
8.0.5
2.0.0-beta7.25374.102
3.4.3
+ 3.2.2
@@ -73,7 +74,7 @@
-
+
@@ -104,9 +105,11 @@
-->
-
+
+
+
-
+
- $(NoWarn);CS1701;xUnit1012;xUnit1014;xUnit2000;xUnit2009;xUnit2013
+ Exe
+ $(NoWarn);CS1701;xUnit1012;xUnit1014;xUnit1051;xUnit2000;xUnit2009;xUnit2013;xUnit2031
$(WarningsAsErrors);xUnit2024
-
+
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/CommandRunnerTest.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/CommandRunnerTest.cs
index 1e1c80f5700..efe30cadbfc 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/CommandRunnerTest.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/CommandRunnerTest.cs
@@ -12,7 +12,6 @@
using NuGet.Common;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest
{
@@ -73,7 +72,7 @@ public void Run_CanGetExitCode()
fileName,
arguments: args,
timeOutInMilliseconds: 10000,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.ExitCode.Should().Be(16);
}
@@ -103,7 +102,7 @@ public void Run_CanWriteToStandardInput()
writer.WriteLine("echo Hello & exit 0");
},
timeOutInMilliseconds: 5000,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.Output.Should().Contain("Hello");
}
@@ -154,7 +153,7 @@ public void Run_DoesNotHangWhenReadingLargeStdout(int outputSizeInKilobytes)
fileName,
Directory.GetCurrentDirectory(),
args,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -193,7 +192,7 @@ public void Run_TimesOut()
Stopwatch stopwatch = Stopwatch.StartNew();
- new Action(() => CommandRunner.Run(fileName, arguments: args, timeOutInMilliseconds: 1000, testOutputHelper: _testOutputHelper, timeoutRetryCount: 0))
+ new Action(() => CommandRunner.Run(fileName, arguments: args, timeOutInMilliseconds: 1000, logLine: _testOutputHelper.WriteLine, timeoutRetryCount: 0))
.Should().Throw();
stopwatch.Stop();
@@ -224,7 +223,7 @@ private void VerifyWithCommandRunner()
fileName,
Directory.GetCurrentDirectory(),
args,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/InstallCommandTests.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/InstallCommandTests.cs
index 50b5cde381d..24a453a9dfe 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/InstallCommandTests.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/InstallCommandTests.cs
@@ -13,7 +13,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest.Commands
{
@@ -249,7 +248,7 @@ public CommandRunnerResult RunInstall(string nugetExe, SimpleTestPathContext pat
pathContext.WorkingDirectory,
string.Join(" ", args),
environmentVariables: envVars,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(expectedExitCode == r.ExitCode, r.AllOutput);
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/PushCommandTest.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/PushCommandTest.cs
index da84161cc08..c7b11944f1f 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/PushCommandTest.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/PushCommandTest.cs
@@ -14,7 +14,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest.Commands
{
@@ -73,7 +72,7 @@ public void PushCommand_AllowsTimeoutToBeSpecifiedHigherThan100Seconds()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
Assert.True(result.Success, $"{result.Output} {result.Errors}");
@@ -117,7 +116,7 @@ public void PushCommand_AllowsTimeoutToBeSpecifiedLowerThan100Seconds()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 1",
timeOutInMilliseconds: 20 * 1000,
- testOutputHelper: _testOutputHelper); // 20 seconds
+ logLine: _testOutputHelper.WriteLine); // 20 seconds
}
// Assert
@@ -158,7 +157,7 @@ public void PushCommand_Server_SkipDuplicate_NotSpecified_PushHalts()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
//Run again so that it will be a duplicate push.
result2 = CommandRunner.Run(
@@ -166,14 +165,14 @@ public void PushCommand_Server_SkipDuplicate_NotSpecified_PushHalts()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
result3 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {sourcePath2} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -224,7 +223,7 @@ public void PushCommand_Server_SkipDuplicate_IsSpecified_PushProceeds()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120 * 1000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
//Run again so that it will be a duplicate push but use the option to skip duplicate packages.
result2 = CommandRunner.Run(
@@ -232,7 +231,7 @@ public void PushCommand_Server_SkipDuplicate_IsSpecified_PushProceeds()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120 * 1000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
//Third run with a different package.
result3 = CommandRunner.Run(
@@ -240,7 +239,7 @@ public void PushCommand_Server_SkipDuplicate_IsSpecified_PushProceeds()
pathContext.WorkingDirectory,
$"push {sourcePath2} -Source {server.Uri}push -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120 * 1000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -287,7 +286,7 @@ public void PushCommand_Server_Snupkg_ByFilename_DoesNotExist_FileNotFoundError(
pathContext.WorkingDirectory,
$"push {snupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -324,7 +323,7 @@ public void PushCommand_Server_Snupkg_ByWildcard_FindsNothing_FileNotFoundError(
pathContext.WorkingDirectory,
$"push {snupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
//Assert
@@ -359,7 +358,7 @@ public void PushCommand_Server_Nupkg_ByFilename_FindsNothing_FileNotFoundError()
pathContext.WorkingDirectory,
$"push {nupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
//Assert
@@ -394,7 +393,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_FindsNothing_FileNotFoundError()
pathContext.WorkingDirectory,
$"push {nupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
//Assert
@@ -438,7 +437,7 @@ public void PushCommand_Server_Nupkg_ByFilename_SnupkgDoesNotExist_NoFileNotFoun
pathContext.WorkingDirectory,
$"push {nupkgFullPath} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -479,7 +478,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_SnupkgDoesNotExist_NoFileNotFoun
pathContext.WorkingDirectory,
$"push {pushArgument} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -531,7 +530,7 @@ public void PushCommand_Server_Nupkg_ByFilename_SnupkgExists_Conflict()
pathContext.WorkingDirectory,
$"push {nupkgFullPath} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
//Second run with SkipDuplicate
result2 = CommandRunner.Run(
@@ -539,7 +538,7 @@ public void PushCommand_Server_Nupkg_ByFilename_SnupkgExists_Conflict()
pathContext.WorkingDirectory,
$"push {nupkgFullPath} -Source {sourceName} -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -599,7 +598,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_NupkgAndSnupkgPushed()
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -655,7 +654,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_SeparateSymbolUrl_NupkgAndSnupkg
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -SymbolSource {symbolSourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -711,7 +710,7 @@ public void PushCommand_Server_Nupkg_SeparateSymbolUrl_NoSymbolTrue_SnupkgNotPus
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -SymbolSource {symbolPushUrl} -noSymbol -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -766,7 +765,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_FindsMatchingSnupkgs_Conflict()
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -SymbolSource {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -830,7 +829,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_FindsMatchingSnupkgs_SkipDuplica
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -890,7 +889,7 @@ public void PushCommand_Server_Snupkg_ByWildcard_FindsMatchingSnupkgs_Conflict()
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -953,7 +952,7 @@ public void PushCommand_Server_Snupkg_ByWildcard_FindsMatchingSnupkgs_SkipDuplic
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -1006,14 +1005,14 @@ public void PushCommand_Server_Snupkg_ByFilename_SnupkgExists_Conflict_ServerMes
pathContext.WorkingDirectory,
$"push {snupkgFileName} -Source {sourceName} -Timeout 110 -Verbosity detailed",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
result2 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {snupkgFileName} -Source {sourceName} -Timeout 110 -SkipDuplicate -Verbosity detailed",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
@@ -1045,7 +1044,7 @@ public void PushCommand_WhenPushingToAnHttpServerV3_WithSymbols_Errors()
packageDirectory,
$"push {snupkgFileName} -Source {sourceName} -Timeout 110 -Verbosity detailed",
timeOutInMilliseconds: 120000,
- testOutputHelper: _testOutputHelper); // 120 seconds
+ logLine: _testOutputHelper.WriteLine); // 120 seconds
// Assert
Assert.False(result.Success, result.AllOutput);
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandSignPackagesTests.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandSignPackagesTests.cs
index 140f10e281e..546890a139a 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandSignPackagesTests.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandSignPackagesTests.cs
@@ -19,7 +19,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest.Commands
{
@@ -435,7 +434,7 @@ public CommandRunnerResult RunRestore(string nugetExe, SimpleTestPathContext pat
pathContext.WorkingDirectory,
string.Join(" ", args),
environmentVariables: envVars,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(expectedExitCode == r.ExitCode, r.AllOutput);
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandTests.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandTests.cs
index efdb5de7758..cb221c5b0e0 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandTests.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandTests.cs
@@ -23,7 +23,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest.Commands
{
@@ -987,7 +986,7 @@ public CommandRunnerResult RunRestore(SimpleTestPathContext pathContext, int exp
pathContext.WorkingDirectory.Path,
string.Join(" ", args),
environmentVariables: envVars,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(expectedExitCode == r.ExitCode, r.AllOutput);
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SearchCommandTests.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SearchCommandTests.cs
index 1e577f99e41..b39d1a915de 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SearchCommandTests.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SearchCommandTests.cs
@@ -11,7 +11,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest.Commands
{
@@ -122,7 +121,7 @@ public void SearchCommand_TargetEndpointTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -232,7 +231,7 @@ public void SearchCommand_VerbosityDetailedTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -346,7 +345,7 @@ public void SearchCommand_VerbosityNormalTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -460,7 +459,7 @@ public void SearchCommand_VerbosityQuietTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -626,7 +625,7 @@ public void SearchCommand_TakeOptionTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -736,7 +735,7 @@ public void SearchCommand_SourceOptionTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -846,7 +845,7 @@ public void SearchCommand_MultipleSearchTermsTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -915,7 +914,7 @@ public void SearchCommand_NoResultsFoundTest()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -983,7 +982,7 @@ public void SearchCommand_WhenSearchWithHttpSource_DisplaysAnErrorMessage()
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server.Stop();
@@ -1094,7 +1093,7 @@ public void SearchCommand_WhenSearchWithHttpSourcesWithAllowInsecureConnections_
nugetexe,
config.WorkingDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
server1.Stop();
server2.Stop();
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SignCommandTests.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SignCommandTests.cs
index afe1d0d6ce5..8e1a3481793 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SignCommandTests.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/SignCommandTests.cs
@@ -13,7 +13,6 @@
using NuGet.Packaging.Signing;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
using HashAlgorithmName = NuGet.Common.HashAlgorithmName;
namespace NuGet.CommandLine.FuncTest.Commands
@@ -71,7 +70,7 @@ public async Task SignCommand_SignPackageAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -105,7 +104,7 @@ public async Task SignCommand_SignPackageWithInvalidEkuFailsAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {invalidEkuCert.StoreName} -CertificateStoreLocation {invalidEkuCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeFalse();
@@ -139,7 +138,7 @@ public async Task SignCommand_SignPackageWithExpiredCertificateFailsAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {expiredCert.StoreName} -CertificateStoreLocation {expiredCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeFalse();
@@ -174,7 +173,7 @@ public async Task SignCommand_SignPackageWithNotYetValidCertificateFailsAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {cert.StoreName} -CertificateStoreLocation {cert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeFalse();
@@ -209,7 +208,7 @@ public async Task SignCommand_SignPackageWithTimestampingAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation} -Timestamper {timestampService.Url.OriginalString}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -243,7 +242,7 @@ public async Task SignCommand_SignPackageWithValidCertChainAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {cert.StoreName} -CertificateStoreLocation {cert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -277,7 +276,7 @@ public async Task SignCommand_SignPackageWithRevokedLeafCertChainAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {cert.StoreName} -CertificateStoreLocation {cert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeFalse();
@@ -311,7 +310,7 @@ public async Task SignCommand_SignPackageWithUnknownRevocationCertChainAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {cert.StoreName} -CertificateStoreLocation {cert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -349,7 +348,7 @@ public async Task SignCommand_SignPackageWithOutputDirectoryAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation} -OutputDirectory {outputDir}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -382,14 +381,14 @@ public async Task SignCommand_ResignPackageWithoutOverwriteFailsAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
var secondResult = CommandRunner.Run(
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeTrue();
@@ -424,13 +423,13 @@ public async Task SignCommand_ResignPackageWithOverwriteSuccessAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var secondResult = CommandRunner.Run(
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation} -Overwrite",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeTrue();
@@ -465,7 +464,7 @@ public async Task SignCommand_SignPackageWithOverwriteSuccessAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation} -Overwrite",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeTrue();
@@ -506,7 +505,7 @@ public async Task SignCommand_SignPackageWithPfxFileSuccessAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificatePath {pfxPath} -CertificatePassword {password}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeTrue();
@@ -551,7 +550,7 @@ public async Task SignCommand_SignPackageWithPfxFileInteractiveSuccessAsync()
{
w.WriteLine(password);
},
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeTrue();
@@ -596,7 +595,7 @@ public async Task SignCommand_SignPackageWithPfxFileInteractiveInvalidPasswordFa
{
w.WriteLine(Guid.NewGuid().ToString());
},
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeFalse();
@@ -637,7 +636,7 @@ public async Task SignCommand_SignPackageWithPfxFileWithoutPasswordAndWithNonInt
_nugetExePath,
dir,
$"sign {packagePath} -CertificatePath {pfxPath} -NonInteractive",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeFalse();
@@ -682,7 +681,7 @@ public async Task SignCommand_SignPackageWithPfxFileWithNonInteractiveAndStdInPa
{
w.WriteLine(Guid.NewGuid().ToString());
},
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.Success.Should().BeFalse();
@@ -706,7 +705,7 @@ public async Task SignCommand_SignPackageWithUntrustedSelfIssuedCertificateInCer
_nugetExePath,
directory,
$"sign {packageFile.FullName} -CertificateFingerprint {certSha256Hash}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(result.Success);
Assert.Contains(_noTimestamperWarningCode, result.AllOutput);
@@ -737,7 +736,7 @@ public async Task SignCommand_SignPackageWithUnsuportedTimestampHashAlgorithm_Sh
_nugetExePath,
directory,
$"sign {packageFile.FullName} -CertificateFingerprint {certSha256Hash} -Timestamper {timestampService.Url}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.False(result.Success);
Assert.Contains(_timestampUnsupportedDigestAlgorithmCode, result.AllOutput);
@@ -794,7 +793,7 @@ private async Task ExecuteSignPackageTestWithCertificateFin
_nugetExePath,
directory,
$"sign {packageFile.FullName} -CertificateFingerprint {certFingerprint} -Timestamper {timestampService.Url}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
return result;
}
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/TrustedSignersCommandTests.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/TrustedSignersCommandTests.cs
index 8f255111c7b..2b71cc5c7e3 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/TrustedSignersCommandTests.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/TrustedSignersCommandTests.cs
@@ -19,7 +19,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
using static NuGet.Commands.TrustedSignersArgs;
namespace NuGet.CommandLine.FuncTest.Commands
@@ -143,7 +142,7 @@ public void TrustedSignersCommand_Failure_InvalidArguments_HelpMessage(string ar
_nugetExePath,
Directory.GetCurrentDirectory(),
$"trusted-signers {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
@@ -182,7 +181,7 @@ public void TrustedSignersCommand_AddTrustedSigner_WithCertificiateFingerprint_A
_nugetExePath,
dir,
$"trusted-signers add -Name signer -CertificateFingerprint abcdefg -FingerprintAlgorithm SHA256 {allowUntrustedRootArg} -Config {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
commandResult.Success.Should().BeTrue();
@@ -229,7 +228,7 @@ public void TrustedSignersCommand_AddTrustedSigner_WithExistingSigner_UpdatesItS
_nugetExePath,
dir,
$"trusted-signers add -Name signer -CertificateFingerprint hijklmn -FingerprintAlgorithm SHA256 {allowUntrustedRootArg} -Config {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
commandResult.Success.Should().BeTrue();
@@ -278,7 +277,7 @@ public async Task TrustedSignersCommand_AddTrustedSigner_WithAuthorSignedPackage
_nugetExePath,
dir,
$"trusted-signers add {signedPackagePath} -Name signer -Author {allowUntrustedRootArg} -Config {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
commandResult.Success.Should().BeTrue();
@@ -329,7 +328,7 @@ public async Task TrustedSignersCommand_AddTrustedSigner_WithAuthorSignedPackage
_nugetExePath,
dir,
$"trusted-signers add {multiplePackagesPath} -Name signer -Author {allowUntrustedRootArg} -Config {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
commandResult.Success.Should().BeFalse();
@@ -379,7 +378,7 @@ public async Task TrustedSignersCommand_AddTrustedSigner_WithRepositorySignedPac
_nugetExePath,
dir,
$"trusted-signers add {signedPackagePath} -Name signer -Repository {allowUntrustedRootArg} {ownersArgs} -Config {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
commandResult.Success.Should().BeTrue();
@@ -441,7 +440,7 @@ public async Task TrustedSignersCommand_AddTrustedSigner_WithRepositoryCountersi
_nugetExePath,
dir,
$"trusted-signers add {signedPackagePath} -Name signer -Repository {allowUntrustedRootArg} {ownersArgs} -Config {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
commandResult.Success.Should().BeTrue();
@@ -486,7 +485,7 @@ public void TrustedSignersCommand_RemoveTrustedSigner_RemovesItSuccessfullyFromC
_nugetExePath,
dir,
$"trusted-signers remove -Name signer -Config {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
commandResult.Success.Should().BeTrue();
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/VerifyCommandTests.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/VerifyCommandTests.cs
index f2479400bde..f2c04cfe9ce 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/VerifyCommandTests.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/VerifyCommandTests.cs
@@ -13,7 +13,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest.Commands
{
@@ -64,7 +63,7 @@ public async Task VerifyCommand_VerifySignedPackageSucceedsAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
signResult.Success.Should().BeTrue();
@@ -73,7 +72,7 @@ public async Task VerifyCommand_VerifySignedPackageSucceedsAsync()
_nugetExePath,
dir,
$"verify {packagePath} -Signatures",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeTrue();
@@ -106,7 +105,7 @@ public async Task VerifyCommand_VerifySignedAndTimestampedPackageSucceedsAsync()
_nugetExePath,
dir,
$"sign {packagePath} -Timestamper {timestampService.Url.OriginalString} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
signResult.Success.Should().BeTrue();
@@ -115,7 +114,7 @@ public async Task VerifyCommand_VerifySignedAndTimestampedPackageSucceedsAsync()
_nugetExePath,
dir,
$"verify {packagePath} -Signatures",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeTrue();
@@ -146,13 +145,13 @@ public async Task VerifyCommand_VerifyResignedPackageSucceedsAsync()
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var secondResult = CommandRunner.Run(
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {_trustedTestCert.StoreName} -CertificateStoreLocation {_trustedTestCert.StoreLocation} -Overwrite",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
firstResult.Success.Should().BeTrue();
secondResult.Success.Should().BeTrue();
@@ -162,7 +161,7 @@ public async Task VerifyCommand_VerifyResignedPackageSucceedsAsync()
_nugetExePath,
dir,
$"verify {packagePath} -Signatures",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeTrue();
@@ -195,7 +194,7 @@ public async Task VerifyCommand_VerifyOnPackageSignedWithValidCertificateChainSu
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {cert.StoreName} -CertificateStoreLocation {cert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
signResult.Success.Should().BeTrue();
@@ -204,7 +203,7 @@ public async Task VerifyCommand_VerifyOnPackageSignedWithValidCertificateChainSu
_nugetExePath,
dir,
$"verify {packagePath} -Signatures",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeTrue();
@@ -237,7 +236,7 @@ public async Task VerifyCommand_VerifyOnPackageSignedWithAllowedCertificateSucce
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {cert.StoreName} -CertificateStoreLocation {cert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
signResult.Success.Should().BeTrue();
@@ -246,7 +245,7 @@ public async Task VerifyCommand_VerifyOnPackageSignedWithAllowedCertificateSucce
_nugetExePath,
dir,
$"verify {packagePath} -Signatures -CertificateFingerprint {certSha256Hash};abc;def",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeTrue();
@@ -279,7 +278,7 @@ public async Task VerifyCommand_VerifyOnPackageSignedWithoutAllowedCertificateFa
_nugetExePath,
dir,
$"sign {packagePath} -CertificateFingerprint {certSha256Hash} -CertificateStoreName {cert.StoreName} -CertificateStoreLocation {cert.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
signResult.Success.Should().BeTrue();
@@ -288,7 +287,7 @@ public async Task VerifyCommand_VerifyOnPackageSignedWithoutAllowedCertificateFa
_nugetExePath,
dir,
$"verify {packagePath} -Signatures -CertificateFingerprint abc;def",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeFalse();
@@ -333,7 +332,7 @@ public async Task Verify_AuthorSignedPackage_WithAuthorItemTrustedCertificate_Su
_nugetExePath,
testDirectory,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// For certificate with trusted root setting allowUntrustedRoot to true/false doesn't matter
@@ -378,7 +377,7 @@ public async Task Verify_AuthorSignedPackage_WithRepositoryItemTrustedCertificat
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeFalse(because: verifyResult.AllOutput);
@@ -425,7 +424,7 @@ public async Task Verify_RepositorySignedPackage_WithAuthorItemUntrustedCertific
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.Success.Should().BeFalse(because: verifyResult.AllOutput);
@@ -479,7 +478,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Unless allowUntrustedRoot is set true in nuget.config verify always fails for cert without trusted root.
@@ -525,7 +524,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// If allowUntrustedRoot is set true in nuget.config then verify succeeds for cert with untrusted root.
@@ -576,7 +575,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Owners is casesensitive, owner info should be "nuget;contoso" not "Nuget;Contoso"
@@ -626,7 +625,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Owners is casesensitive, here owner "nuget" matches
@@ -676,7 +675,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemTrustedCertif
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Owners is casesensitive, owner info should be "nuget;contoso" not "Nuget;Contoso"
@@ -725,7 +724,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemTrustedCertif
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -Signatures {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// For certificate with trusted root setting allowUntrustedRoot value true/false doesn't matter.
@@ -769,7 +768,7 @@ public async Task VerifyCommand_AuthorSignedPackage_WithUntrustedCertificate_All
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -All -CertificateFingerprint {certificateFingerprintString};def -ConfigFile {nugetConfigPath2}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// allowUntrustedRoot is not set true in nuget2.config, but in nuget.config, so verify fails.
@@ -812,7 +811,7 @@ public async Task VerifyCommand_AuthorSignedPackage_WithUntrustedCertificate_All
_nugetExePath,
pathContext.PackageSource,
$"verify {signedPackagePath} -All -CertificateFingerprint {certificateFingerprintString};def -ConfigFile {nugetConfigPath2}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// allowUntrustedRoot is set true in nuget2.config, so verify succeeds.
diff --git a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/RetryRunnerTest.cs b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/RetryRunnerTest.cs
index 19823f5a446..295d34f8afa 100644
--- a/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/RetryRunnerTest.cs
+++ b/test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/RetryRunnerTest.cs
@@ -5,7 +5,6 @@
using FluentAssertions;
using Microsoft.Internal.NuGet.Testing.SignedPackages.ChildProcess;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.FuncTest
{
@@ -31,7 +30,7 @@ public void RunWithRetries_WhenNoException_ShouldReturnResult()
};
// Act
- int result = RetryRunner.RunWithRetries(func, maxRetries, _output);
+ int result = RetryRunner.RunWithRetries(func, maxRetries, _output.WriteLine);
// Assert
result.Should().Be(42);
@@ -55,7 +54,7 @@ public void RunWithRetries_OnException_ShouldRetry()
};
// Act
- int result = RetryRunner.RunWithRetries(func, maxRetries, _output);
+ int result = RetryRunner.RunWithRetries(func, maxRetries, _output.WriteLine);
// Assert
result.Should().Be(42);
@@ -79,7 +78,7 @@ public void RunWithRetries_OnSuccess_ShouldNotRetry()
};
// Act
- int result = RetryRunner.RunWithRetries(func, maxRetries, _output);
+ int result = RetryRunner.RunWithRetries(func, maxRetries, _output.WriteLine);
// Assert
result.Should().Be(42);
@@ -99,7 +98,7 @@ public void RunWithRetries_WhenMaxRetriesIsZero_ShouldNotRetry()
};
// Act and Assert
- Assert.Throws(() => RetryRunner.RunWithRetries(func, maxRetries, _output));
+ Assert.Throws(() => RetryRunner.RunWithRetries(func, maxRetries, _output.WriteLine));
runCount.Should().Be(1);
}
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/FeedPackagePruningTests.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/FeedPackagePruningTests.cs
index aaf8368d4e5..bfbf686fd9e 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/FeedPackagePruningTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/FeedPackagePruningTests.cs
@@ -14,7 +14,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -78,14 +77,14 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
var feedUrl = server.Uri + "index.json";
pathContext.Settings.AddSource(feedUrl, feedUrl, allowInsecureConnectionsValue: "true");
// Restore x 2.0.0 and populate the http cache
- var r = Util.Restore(pathContext, projectA.ProjectPath, 0, _testOutputHelper, "-Source", feedUrl);
+ var r = Util.Restore(pathContext, projectA.ProjectPath, 0, _testOutputHelper.WriteLine, "-Source", feedUrl);
// Delete x 1.0.0
File.Delete(LocalFolderUtility.GetPackageV2(serverRepoPath, packageX100.Identity, testLogger).Path);
// Act
// Restore x 1.0.0
- r = Util.Restore(pathContext, projectB.ProjectPath, 0, _testOutputHelper, "-Source", feedUrl);
+ r = Util.Restore(pathContext, projectB.ProjectPath, 0, _testOutputHelper.WriteLine, "-Source", feedUrl);
var xLib = projectB.AssetsFile.Libraries.SingleOrDefault(e => e.Name == "x");
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/MSBuildProjectSystemTests.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/MSBuildProjectSystemTests.cs
index 831bc854484..55a53fbb3f7 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/MSBuildProjectSystemTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/MSBuildProjectSystemTests.cs
@@ -12,7 +12,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetClientCertCommandTests.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetClientCertCommandTests.cs
index 075e42c3075..38d3154304b 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetClientCertCommandTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetClientCertCommandTests.cs
@@ -14,7 +14,6 @@
using NuGet.Configuration;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -52,7 +51,7 @@ public void ClientCertAddCommand_Fail_CertificateSourceCombinationSpecified()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "Invalid combination of arguments";
@@ -81,7 +80,7 @@ public void ClientCertAddCommand_Fail_CertificateSourceNotSpecified()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "Invalid combination of arguments";
@@ -112,7 +111,7 @@ public void ClientCertAddCommand_Fail_FileCertificateNotExist()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "file that does not exist";
@@ -133,7 +132,7 @@ public void ClientCertAddCommand_Fail_NoSourceSpecified()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "Property 'PackageSource' should not be null or empty";
@@ -164,7 +163,7 @@ public void ClientCertAddCommand_Fail_StoreCertificateNotExist()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "was not found";
@@ -487,7 +486,7 @@ public void ClientCertUpdateCommand_Fail_CertificateSourceCombinationSpecified()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "Invalid combination of arguments";
@@ -520,7 +519,7 @@ public void ClientCertUpdateCommand_Fail_CertificateSourceNotFound()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "does not exist";
@@ -549,7 +548,7 @@ public void ClientCertUpdateCommand_Fail_CertificateSourceNotSpecified()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "Invalid combination of arguments";
@@ -679,7 +678,7 @@ public void ClientCertUpdatedCommand_Fail_FileCertificateNotExist()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "A fileCert path specified a file that does not exist";
@@ -715,7 +714,7 @@ public void ClientCertUpdatedCommand_Fail_NotConfigured()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "does not exist";
@@ -763,7 +762,7 @@ public void ClientCertUpdatedCommand_Fail_StoreCertificateNotExist()
testInfo.NuGetExePath,
testInfo.WorkingPath,
string.Join(" ", args.Select(a => $"\"{a}\"")),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = "was not found";
@@ -854,7 +853,7 @@ public void RunNuGetExpectSuccess(string[] args, string expectedOutput = null)
NuGetExePath,
WorkingPath,
arguments,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
LogInstalledCertificates();
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetMockServerTests.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetMockServerTests.cs
index 1bbf28f523a..8f3887d0dce 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetMockServerTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetMockServerTests.cs
@@ -13,7 +13,6 @@
using NuGet.Protocol;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -73,7 +72,7 @@ public void MockServer_VerifySessionId(ProjectStyle projectStyle)
pathContext.Settings.AddSource("http-feed", server.Uri + "nuget", allowInsecureConnectionsValue: "true");
server.Start();
- var result = Util.Restore(pathContext, inputPath, 0, _testOutputHelper, "-Source", server.Uri + "nuget");
+ var result = Util.Restore(pathContext, inputPath, 0, _testOutputHelper.WriteLine, "-Source", server.Uri + "nuget");
result.Success.Should().BeTrue();
ids.All(s => !string.IsNullOrEmpty(s) && Guid.TryParse(s, out var r)).Should().BeTrue("the values should guids");
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetPackCommandTest.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetPackCommandTest.cs
index 4a933faa8f1..b17c0cc56cc 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetPackCommandTest.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetPackCommandTest.cs
@@ -22,7 +22,6 @@
using NuGet.Test.Utility;
using NuGet.Versioning;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -84,7 +83,7 @@ public void PackCommand_IncludeExcludePackageFromNuspec()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -163,7 +162,7 @@ public void PackCommand_AutomaticallyExcludeNuspecs()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -217,7 +216,7 @@ public void PackCommand_PackageFromNuspecWithFrameworkAssemblies()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -283,7 +282,7 @@ public void PackCommand_PackageFromNuspecWithEmptyFilesTag()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -331,7 +330,7 @@ public void PackCommand_PackageFromNuspecWithoutEmptyFilesTag()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -374,7 +373,7 @@ public void PackCommand_PackageFromNuspecWithTokenReplacement()
nugetexe,
workingDirectory,
"pack packageA.nuspec -Properties version=2.0.0;prerelease=-preview;package=test",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -437,7 +436,7 @@ public void PackCommand_PackRuntimesRefNativeNoWarnings()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -492,7 +491,7 @@ public void PackCommand_PackAnalyzers()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -560,7 +559,7 @@ public void PackCommand_SymbolPackageWithNuspecFile()
nugetexe,
workingDirectory,
"pack packageA.nuspec -symbols -SymbolPackageFormat snupkg",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -645,7 +644,7 @@ public void PackCommand_WhenPackingSymbolsPackage_ExcludesExplicitAssemblyRefere
nugetexe,
workingDirectory,
"pack packageA.nuspec -symbols -SymbolPackageFormat snupkg",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.Success, r.AllOutput);
// Assert
@@ -728,7 +727,7 @@ public void PackCommand_SymbolPackageWithNuspecFileAndPackageType()
nugetexe,
workingDirectory,
"pack packageA.nuspec -symbols -SymbolPackageFormat snupkg",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -807,7 +806,7 @@ public void PackCommand_ContentV2PackageFromNuspec()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -926,7 +925,7 @@ public class Class1
nugetexe,
proj2Directory,
"pack proj2.csproj -build -IncludeReferencedProjects",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -1011,7 +1010,7 @@ public class Class1
nugetexe,
proj1Directory,
"restore packages.config -PackagesDirectory " + packagesDirectory,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(t.Success, t.AllOutput);
// Act
@@ -1019,7 +1018,7 @@ public class Class1
nugetexe,
proj1Directory,
"pack proj1.csproj -build ",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -1114,7 +1113,7 @@ public class Class1
nugetexe,
proj2Directory,
$"pack proj2.csproj -build -IncludeReferencedProjects -symbols -SymbolPackageFormat {extension}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -1188,7 +1187,7 @@ public void PackCommand_IncludesDllSymbols(SymbolPackageFormat symbolPackageForm
nugetexe,
projDirectory,
$"pack A.csproj -build -symbols -SymbolPackageFormat {extension}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(result.ExitCode == 0, result.Output + " " + result.Errors);
// Assert
@@ -1260,7 +1259,7 @@ public static void Main() { }
nugetexe,
projDirectory,
$"pack A.csproj -build -symbols -SymbolPackageFormat {extension}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(result.ExitCode == 0, result.Output + " " + result.Errors);
// Assert
@@ -1331,7 +1330,7 @@ public class B
nugetexe,
projDirectory,
"pack A.csproj -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(result.ExitCode == 0, result.Output + " " + result.Errors);
// Assert
@@ -1428,7 +1427,7 @@ public void PackCommand_ReferencedProjectWithNuspecFile()
nugetexe,
proj1Directory,
"pack proj1.csproj -build -IncludeReferencedProjects",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -1539,7 +1538,7 @@ public void PackCommand_ReferencedProjectWithNuspecFileWithMsbuild14()
nugetexe,
proj1Directory,
$@"pack proj1.csproj -build -IncludeReferencedProjects -MSBuildVersion {version}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -1644,7 +1643,7 @@ public void PackCommand_ReferencedProjectWithNuspecFileWithMsbuild15OnMono()
nugetexe,
proj1Directory,
$@"pack proj1.csproj -build -IncludeReferencedProjects -MSBuildVersion 15.0",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -1755,7 +1754,7 @@ public void PackCommand_ReferencedProjectWithCustomTokensInNuspec()
nugetexe,
proj1Directory,
"pack proj1.csproj -build -IncludeReferencedProjects -Properties prefix=" + prefixTokenValue,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -1791,7 +1790,7 @@ public void PackCommand_NuspecFileWithTokensWithInvalidInformationVersion_FallsB
var projectDirectory = Path.Combine(workingDirectory, "Foo");
// Act
- var r = CommandRunner.Run(nugetexe, projectDirectory, "pack Foo.csproj -build", testOutputHelper: _testOutputHelper);
+ var r = CommandRunner.Run(nugetexe, projectDirectory, "pack Foo.csproj -build", logLine: _testOutputHelper.WriteLine);
// The assembly version was used, not the informational version
var outputPackageFileName = Path.Combine(projectDirectory, $"Foo.{version}.nupkg");
@@ -1819,7 +1818,7 @@ public void PackCommand_NuspecFileWithTokens_UsesInformationalVersion()
var projectDirectory = Path.Combine(workingDirectory, "Foo");
// Act
- var r = CommandRunner.Run(nugetexe, projectDirectory, "pack Foo.csproj -build", testOutputHelper: _testOutputHelper);
+ var r = CommandRunner.Run(nugetexe, projectDirectory, "pack Foo.csproj -build", logLine: _testOutputHelper.WriteLine);
// The informational version without the build metadata part was used
var outputPackageFileName = Path.Combine(projectDirectory, $"Foo.{semverVersion}.nupkg");
@@ -1996,7 +1995,7 @@ public void PackCommand_NuspecFileWithTokens()
nugetexe,
proj1Directory,
"pack proj1.csproj -build -IncludeReferencedProjects",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -2059,7 +2058,7 @@ public void PackCommand_OutputResolvedNuSpecFileAttemptToOverwriteOriginal()
Util.GetNuGetExePath(),
workingDirectory,
"pack packageA.nuspec -InstallPackageToOutputPath",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
@@ -2132,7 +2131,7 @@ public void PackCommand_InstallPackageToOutputPath()
Util.GetNuGetExePath(),
workingDirectory,
arguments,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
@@ -2234,7 +2233,7 @@ public void PackCommand_InstallPackageToOutputPathWithResponseFile()
Util.GetNuGetExePath(),
workingDirectory,
"@" + responseFilePath,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
@@ -2298,7 +2297,7 @@ public void PackCommand_OutputDirectorySuffixes(string suffix)
nugetexe,
proj1Directory,
$"pack proj1.csproj -build -IncludeReferencedProjects -outputDirectory \"{outputDirectory}\"",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + Environment.NewLine + r.Errors);
@@ -2348,7 +2347,7 @@ public void PackCommand_ProjectReferencedByMultipleProjects()
nugetexe,
proj1Directory,
"pack proj1.csproj -build -IncludeReferencedProjects",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -2391,7 +2390,7 @@ public void PackCommand_ReferencedProjectWithDifferentTarget()
nugetexe,
proj1Directory,
"pack proj1.csproj -build -IncludeReferencedProjects",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -2514,14 +2513,14 @@ public class Class1
msbuild,
proj2Directory,
"proj2.csproj /p:Config=Release",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
r = CommandRunner.Run(
nugetexe,
proj2Directory,
"pack proj2.csproj -p Config=Release",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -2635,7 +2634,7 @@ public class Class1
nugetexe,
proj2Directory,
"pack proj2.csproj -build -IncludeReferencedProjects -p Config=Release",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -2695,7 +2694,7 @@ public void PackCommand_ExcludesFilesOutsideRoot()
nugetexe,
projDirectory,
"pack package.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
@@ -2785,7 +2784,7 @@ public class Class1
nugetexe,
proj1Directory,
"pack proj1.csproj -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -2872,7 +2871,7 @@ public class Class1
nugetexe,
proj1Directory,
"pack proj1.csproj -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -2991,7 +2990,7 @@ public class Class1
nugetexe,
proj1Directory,
"pack proj1.csproj -build -IncludeReferencedProjects",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -3106,7 +3105,7 @@ public class Class1
nugetexe,
proj1Directory,
"pack proj1.csproj -build -IncludeReferencedProjects",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -3213,14 +3212,14 @@ public class Class1
msbuild,
proj1Directory,
"proj1.csproj /p:Config=Release",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
r = CommandRunner.Run(
nugetexe,
proj1Directory,
"pack proj1.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -3330,7 +3329,7 @@ public string F2(int a)
nugetexe,
proj2Directory,
$@"pack proj2.csproj -build -IncludeReferencedProjects -p Config=Release -msbuildversion 14",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
@@ -3455,7 +3454,7 @@ public string F2(int a)
nugetexe,
proj2Directory,
$@"pack proj2.csproj -build -IncludeReferencedProjects -p Config=Release -msbuildversion 15.0",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
@@ -3580,7 +3579,7 @@ public string F2(int a)
nugetexe,
proj2Directory,
@"pack proj2.csproj -build -IncludeReferencedProjects -p Config=Release -MSBuildVersion 15.1",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -3708,7 +3707,7 @@ public string F2(int a)
nugetexe,
proj2Directory,
$@"pack proj2.csproj -build -IncludeReferencedProjects -p Config=Release -MSBuildPath ""{msbuildPath}"" ",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -3837,7 +3836,7 @@ public string F2(int a)
nugetexe,
proj2Directory,
$@"pack proj2.csproj -build -IncludeReferencedProjects -p Config=Release -MSBuildPath ""{msbuildPath}"" -MSBuildVersion 12 ",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -3963,7 +3962,7 @@ public string F2(int a)
nugetexe,
proj2Directory,
$@"pack proj2.csproj -build -IncludeReferencedProjects -p Config=Release -MSBuildPath ""{msbuildPath}"" ",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -3987,7 +3986,7 @@ public void PackCommand_VersionSuffixIsAssigned()
nugetexe,
proj1Directory,
"pack proj1.csproj -Build -Suffix alpha",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -4099,7 +4098,7 @@ public void PackCommand_PackageFromNuspecWithXmlEncoding()
nugetexe,
workingDirectory,
"pack packageA.nuspec -verbosity detailed",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -4189,7 +4188,7 @@ public void PackCommand_MissingPackageCausesError()
nugetexe,
proj1Directory,
"pack proj1.csproj -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.Equal(1, r.ExitCode);
// Assert
@@ -4235,7 +4234,7 @@ public void PackCommand_SemVer200()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -4311,7 +4310,7 @@ public class Class1
nugetexe,
proj1ProjectDirectory,
@"pack proj1.csproj -build -IncludeReferencedProjects -Properties Configuration=Release",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -4383,7 +4382,7 @@ public class Class1
nugetexe,
proj1Directory,
$"pack proj1.csproj -build -version 1.0.0-rtm+asdassd",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
r.Success.Should().BeTrue(because: r.AllOutput);
var expectedMessage = "WARNING: " + NuGetLogCode.NU5115.ToString();
if (expectToWarn)
@@ -4452,7 +4451,7 @@ public class Class1
nugetexe,
proj1Directory,
$"pack proj1.csproj -build -version 1.0.0-rtm+asdassd",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, "proj1", "proj1.1.0.0-rtm.nupkg");
@@ -4526,7 +4525,7 @@ public class Class1
nugetexe,
proj1Directory,
$"pack proj1.csproj -build -version 1.0.0-rtm+asdassd",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, "proj1", "proj1.1.0.0-rtm.nupkg");
@@ -4574,7 +4573,7 @@ public void PackCommand_PackLicense_SimpleExpression_StandardLicense(string lice
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -4638,7 +4637,7 @@ public void PackCommand_PackLicense_ComplexExpression_WithNonStandardLicense()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -4703,7 +4702,7 @@ public void PackCommand_PackLicense_NonParsableExpressionFailsErrorWithCode(stri
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// This should fail.
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
@@ -4751,7 +4750,7 @@ public void PackCommand_PackLicense_NonParsableVersionFailsErrorWithCode()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// This should fail.
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
@@ -4799,7 +4798,7 @@ public void PackCommand_PackLicense_ExpressionVersionHigherFailsWithErrorCode()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// This should fail.
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
@@ -4853,7 +4852,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile(string licenseFileName)
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -4921,7 +4920,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileNotInPackage()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// This should fail.
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
@@ -4972,7 +4971,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileExtensionNotValid()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// This should fail.
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
@@ -5024,7 +5023,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_LicenseTypeIsNotValid()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// This should fail.
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
@@ -5073,7 +5072,7 @@ public void PackCommand_PackLicense_PackBasicLicense_LicenseValueIsEmpty(string
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// This should fail.
Assert.True(1 == r.ExitCode, r.Output + " " + r.Errors);
@@ -5119,7 +5118,7 @@ public void PackCommand_PackLicense_LicenseUrlIsBeingDeprecated()
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
Assert.Contains("NU5125", r.Output);
@@ -5185,7 +5184,7 @@ public void PackCommand_PackLicense_BasicLicenseFileReadFileFromNupkg(string lic
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -5289,7 +5288,7 @@ public void PackCommand_PackLicense_LicenseInformationIsNotIncludedInTheSnupkg(S
nugetexe,
workingDirectory,
$"pack {packageName}.csproj -build -symbols -SymbolPackageFormat {extension}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -5392,7 +5391,7 @@ public void PackCommand_PackageFromNuspecWithFrameworkReferences_MultiTargeting(
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -5460,7 +5459,7 @@ public void PackCommand_PackageFromNuspecWithFrameworkReferences_WithDuplicateEn
nugetexe,
workingDirectory,
"pack packageA.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -5611,7 +5610,7 @@ public void PackCommand_PackIconUrl_Warn_Succeeds()
Util.GetNuGetExePath(),
testDirBuilder.BaseDir,
$"pack {testDirBuilder.NuspecPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Util.VerifyResultSuccess(r, expectedOutputMessage: NuGetLogCode.NU5048.ToString());
Assert.Contains(AnalysisResources.IconUrlDeprecationWarning, r.Output);
@@ -5761,7 +5760,7 @@ public void PackCommand_PackIcon_SymbolsPackage_MustNotHaveIconInfo_Succeed(Symb
Util.GetNuGetExePath(),
testDirBuilder.BaseDir,
$"pack A.csproj -Build -Symbols -SymbolPackageFormat {symbolExtension}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Verify
Util.VerifyResultSuccess(r);
@@ -5830,7 +5829,7 @@ public void PackCommand_ProjectFile_PackageIconUrl_WithNuspec_WithPackTask_Warns
Util.GetNuGetExePath(),
testDirBuilder.BaseDir,
$"pack A.csproj -Build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Util.VerifyResultSuccess(r, expectedOutputMessage: NuGetLogCode.NU5048.ToString());
Assert.Contains(AnalysisResources.IconUrlDeprecationWarning, r.Output);
@@ -5872,7 +5871,7 @@ private void TestPackIconSuccess(TestDirectoryBuilder testDirBuilder, string ico
Util.GetNuGetExePath(),
testDirBuilder.BaseDir,
$"pack {testDirBuilder.NuspecPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Util.VerifyResultSuccess(r, message);
@@ -5904,7 +5903,7 @@ private void TestPackPropertyFailure(TestDirectoryBuilder testDirBuilder, string
Util.GetNuGetExePath(),
testDirBuilder.BaseDir,
$"pack {testDirBuilder.NuspecPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Util.VerifyResultFailure(r, message);
@@ -6268,7 +6267,7 @@ private void TestPackReadmeSuccess(TestDirectoryBuilder testDirBuilder, string r
Util.GetNuGetExePath(),
testDirBuilder.BaseDir,
$"pack {testDirBuilder.NuspecPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Util.VerifyResultSuccess(r, message);
@@ -6341,7 +6340,7 @@ public void PackCommand_Deterministic_MultiplePackInvocations_CreateIdenticalPac
nugetexe,
workingDirectory,
string.Format(command, path),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
@@ -6421,7 +6420,7 @@ public void PackCommand_ExplicitSolutionDir()
nugetexe,
proj1Directory,
"pack proj1.csproj -build -solutionDir ../solution",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.Success, r.AllOutput);
}
}
@@ -6471,7 +6470,7 @@ public void PackCommand_ExplicitPackagesDir()
nugetexe,
proj1Directory,
"pack proj1.csproj -build -packagesDir ../pkgs",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.Success, r.AllOutput);
}
}
@@ -6597,7 +6596,7 @@ class Program {{
nugetexe,
proj1Directory,
$"pack proj1.csproj -build -packagesDir {packagesFolder} -solutionDir {solDirectory}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Util.VerifyResultSuccess(r);
Assert.True(File.Exists(Path.Combine(proj1Directory, "proj1.0.0.0.nupkg")));
@@ -6606,7 +6605,7 @@ class Program {{
nugetexe,
proj3Directory,
$"pack proj3.csproj -build -packagesDir {packagesFolder2} -solutionDir {solDirectory} -configFile {Path.Combine(solDirectory, "AlternateNuget.config")}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Util.VerifyResultSuccess(r2);
Assert.True(File.Exists(Path.Combine(proj3Directory, "proj3.0.0.0.nupkg")));
}
@@ -6664,7 +6663,7 @@ public class Class1
nugetexe,
proj1Directory,
$"pack proj1.csproj -build -version 1.0.0-rtm+asdassd",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
r.Success.Should().BeTrue(because: r.AllOutput);
r.AllOutput.Should().NotContain(NuGetLogCode.NU5105.ToString());
}
@@ -6765,7 +6764,7 @@ public class Class1
nugetexe,
projectDirectory,
"pack -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -6885,7 +6884,7 @@ public class Class1
renamedNuGetExe,
projectDirectory,
"pack -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
// Assert
@@ -6931,7 +6930,7 @@ public void PackCommand_RequireLicenseAcceptanceNotEmitted()
nugetexe,
projDirectory,
"pack A.csproj -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(result.ExitCode == 0, result.Output + " " + result.Errors);
// Assert
@@ -6978,12 +6977,12 @@ public void PackCommand_NoProjectFileWithDefaultNuspec_GlobsAllFiles()
nugetexe,
workingDirectory,
"spec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult packResult = CommandRunner.Run(
nugetexe,
workingDirectory,
"pack Package.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == specResult.ExitCode, specResult.AllOutput);
Assert.True(0 == packResult.ExitCode, packResult.AllOutput);
@@ -7058,7 +7057,7 @@ public class Class1
nugetexe,
workingDirectory,
"spec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(0 == specResult.ExitCode, specResult.AllOutput);
@@ -7066,7 +7065,7 @@ public class Class1
nugetexe,
workingDirectory,
" pack -properties tagVar=CustomTag;author=microsoft.com;Description=aaaaaaa -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(0 == packResult.ExitCode, packResult.AllOutput);
@@ -7129,7 +7128,7 @@ public class Class1
Util.GetNuGetExePath(),
proj1Directory,
"pack proj1.csproj -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
r.Success.Should().BeFalse();
r.AllOutput.Should().Contain("NU5049");
r.AllOutput.Should().Contain("dotnet pack");
@@ -7180,7 +7179,7 @@ public class Class1
{
{ "NUGET_ENABLE_LEGACY_CSPROJ_PACK", "true" }
},
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
r.Success.Should().BeTrue();
r.AllOutput.Should().NotContain("NU5049");
r.AllOutput.Should().NotContain("dotnet pack");
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetRestoreCommandTest.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetRestoreCommandTest.cs
index b7579e26f29..7bb24324655 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetRestoreCommandTest.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetRestoreCommandTest.cs
@@ -3596,7 +3596,7 @@ public void RestoreCommand_WithMultipleProjectsInSameDirectory_RaisesAppropriate
}
[SkipMono()]
- public async void RestoreCommand_WithPackagesConfigProject_PackageWithVulnerabilities_WithSuppressedAdvisories_SuppressesExpectedVulnerabilities()
+ public async Task RestoreCommand_WithPackagesConfigProject_PackageWithVulnerabilities_WithSuppressedAdvisories_SuppressesExpectedVulnerabilities()
{
// Arrange
var nugetexe = Util.GetNuGetExePath();
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
index 86bf7c8d57c..7f396cb61d6 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
@@ -21,7 +21,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -134,7 +133,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -217,7 +216,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -340,7 +339,7 @@ await msBuildProject2.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -435,7 +434,7 @@ await msBuildProject1.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -523,7 +522,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -605,7 +604,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -687,7 +686,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -776,7 +775,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -869,7 +868,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -962,7 +961,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -1045,7 +1044,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -1128,7 +1127,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
System.Console.WriteLine(r.Output);
@@ -1238,7 +1237,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
@@ -1335,7 +1334,7 @@ await msBuildProject1.InstallPackageAsync(
Util.GetNuGetExePath(),
solutionDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Should be no errors returned - used to fail as update command assumed folder was \packages.
Assert.Empty(r.Errors);
@@ -1426,7 +1425,7 @@ public void UpdateCommand_FromProjectConfig(string configFileName)
nugetexe,
solutionDirectory,
string.Join(" ", restoreArgs),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
var args = new[]
@@ -1521,7 +1520,7 @@ await msBuildProject1.InstallPackageAsync(
Util.GetNuGetExePath(),
solutionDirectory,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Should be no errors returned - used to fail as update command assumed folder was \packages.
Assert.Empty(r.Errors);
@@ -1650,7 +1649,7 @@ await msBuildProject2.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(r.ExitCode == 0, "Output is " + r.Output + ". Error is " + r.Errors);
}
@@ -1743,7 +1742,7 @@ await msBuildProject.InstallPackageAsync(
Util.GetNuGetExePath(),
workingPath,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
//Assert
Assert.True(commandRunResult.ExitCode == 0, "Output is " + commandRunResult.Output + ". Error is " + commandRunResult.Errors);
@@ -1778,7 +1777,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var nugetExe = Path.Combine(pathContext.WorkingDirectory, "NuGet.exe");
File.Copy(Util.GetNuGetExePath(), nugetExe);
- Util.RunCommand(pathContext, nugetExe, 0, testOutputHelper: _testOutputHelper, "update", "-self", "-source", pathContext.PackageSource);
+ Util.RunCommand(pathContext, nugetExe, 0, logLine: _testOutputHelper.WriteLine, "update", "-self", "-source", pathContext.PackageSource);
Assert.Equal(expectedFileContent, File.ReadAllBytes(nugetExe));
}
@@ -1793,7 +1792,7 @@ public void UpdateCommand_Self_FailsWithMoreThanOneSource()
var nugetExe = Path.Combine(pathContext.WorkingDirectory, "NuGet.exe");
File.Copy(Util.GetNuGetExePath(), nugetExe);
- CommandRunnerResult result = Util.RunCommand(pathContext, nugetExe, 1, testOutputHelper: _testOutputHelper, "update", "-self", "-source", pathContext.PackageSource, "-source", pathContext.HttpCacheFolder);
+ CommandRunnerResult result = Util.RunCommand(pathContext, nugetExe, 1, logLine: _testOutputHelper.WriteLine, "update", "-self", "-source", pathContext.PackageSource, "-source", pathContext.HttpCacheFolder);
result.ExitCode.Equals(1);
result.AllOutput.Contains(NuGetResources.Error_UpdateSelf_Source);
}
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/ProjectFactoryTest.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/ProjectFactoryTest.cs
index 785847c4973..271f5d86d0b 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/ProjectFactoryTest.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/ProjectFactoryTest.cs
@@ -23,7 +23,6 @@ namespace NuGet.CommandLine
using global::Test.Utility;
using Microsoft.Internal.NuGet.Testing.SignedPackages.ChildProcess;
using NuGet.Packaging;
- using Xunit.Abstractions;
public class ProjectFactoryTest
{
@@ -487,7 +486,7 @@ public async Task EnsureProjectFactoryDoesNotAddFileThatIsAlreadyInPackage()
nugetexe,
workingDirectory,
"pack Assembly.csproj -build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Util.VerifyResultSuccess(r);
@@ -531,7 +530,7 @@ public async Task EnsureProjectFactoryWorksAsExpectedWithReferenceOutputAssembly
nugetexe,
workingDirectory,
$"pack Link{Path.DirectorySeparatorChar}Link.csproj -build -IncludeReferencedProjects -Version 1.0.0",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Util.VerifyResultSuccess(r);
@@ -585,7 +584,7 @@ public async Task EnsureProjectFactoryWorksAsExpectedWithReferenceOutputAssembly
nugetexe,
workingDirectory,
$"pack Link{Path.DirectorySeparatorChar}Link.csproj -build -IncludeReferencedProjects -Version 1.0.0",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Util.VerifyResultSuccess(r);
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RegistryKeyUtilityTests.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RegistryKeyUtilityTests.cs
index f0bd9e63c03..3edc8bd71d5 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RegistryKeyUtilityTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RegistryKeyUtilityTests.cs
@@ -5,7 +5,6 @@
using Microsoft.Win32;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreLoggingTests.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreLoggingTests.cs
index a1dd6204b05..eed2f6f3f44 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreLoggingTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreLoggingTests.cs
@@ -14,7 +14,6 @@
using NuGet.Frameworks;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -72,7 +71,7 @@ public async Task RestoreLogging_VerifyNU1605DowngradeWarningAsync()
doc.Save(projectA.ProjectPath);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -135,7 +134,7 @@ public async Task RestoreLogging_VerifyNU1608MessageAsync()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
var log = projectA.AssetsFile.LogMessages.SingleOrDefault(e => e.Code == NuGetLogCode.NU1608);
// Assert
@@ -204,11 +203,11 @@ public async Task RestoreLogging_MissingNuspecInGlobalPackages_FailsWithNU5037As
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
//delete the project.assets file to avoid no-op restore
File.Delete(projectA.AssetsFileOutputPath);
File.Delete(Path.Combine(pathContext.UserPackagesFolder, packageX.Id, packageX.Version, packageX.Id + NuGetConstants.ManifestExtension));
- r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -279,7 +278,7 @@ public async Task RestoreLogging_VerifyNU1107DoesNotDisplayNU1608AlsoAsync()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -317,7 +316,7 @@ public void RestoreLogging_VerifyCompatErrorNU1201Properties()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var log = projectA.AssetsFile.LogMessages.SingleOrDefault(e => e.Code == NuGetLogCode.NU1201 && e.TargetGraphs.All(g => !g.Contains("/")));
// Assert
@@ -360,7 +359,7 @@ public async Task RestoreLogging_VerifyCompatErrorNU1202PropertiesAsync()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var log = projectA.AssetsFile.LogMessages.SingleOrDefault(e => e.Code == NuGetLogCode.NU1202 && e.TargetGraphs.All(g => !g.Contains("/")));
// Assert
@@ -404,7 +403,7 @@ public async Task RestoreLogging_VerifyCompatErrorNU1203PropertiesAsync()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var log = projectA.AssetsFile.LogMessages.OrderBy(e => e.Message, StringComparer.Ordinal).FirstOrDefault(e => e.Code == NuGetLogCode.NU1203);
// Assert
@@ -447,7 +446,7 @@ public async Task RestoreLogging_VerifyCircularDependencyErrorNU1106PropertiesAs
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var log = projectA.AssetsFile.LogMessages.SingleOrDefault(e => e.Code == NuGetLogCode.NU1108 && e.TargetGraphs.All(g => !g.Contains("/")));
// Assert
@@ -523,7 +522,7 @@ public async Task RestoreLogging_VerifyConflictErrorNU1107PropertiesAsync()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var log = projectA.AssetsFile.LogMessages.SingleOrDefault(e => e.Code == NuGetLogCode.NU1107 && e.TargetGraphs.All(g => !g.Contains("/")));
// Assert
@@ -604,7 +603,7 @@ public async Task RestoreLogging_VerifyConflictErrorNU1107IsResolvedByTopLevelRe
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -651,7 +650,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -701,7 +700,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -756,7 +755,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -812,7 +811,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -863,7 +862,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -916,7 +915,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -967,7 +966,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -1018,7 +1017,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1069,7 +1068,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -1118,7 +1117,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1169,7 +1168,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1220,7 +1219,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1269,7 +1268,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1321,7 +1320,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1372,7 +1371,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1420,7 +1419,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1470,7 +1469,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -1525,7 +1524,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1581,7 +1580,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -1632,7 +1631,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1685,7 +1684,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1736,7 +1735,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -1787,7 +1786,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1838,7 +1837,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -1887,7 +1886,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1936,7 +1935,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -1988,7 +1987,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -2040,7 +2039,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX9);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -2073,7 +2072,7 @@ public void RestoreLogging_PackagesLockFile_InvalidInputError()
File.Create(projectA.NuGetLockFileOutputPath).Close();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -2121,14 +2120,14 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
pathContext.PackageSource,
packageX, packageY);
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
projectA.AddPackageToAllFrameworks(packageY);
projectA.Properties.Add("RestoreLockedMode", "true");
projectA.Save();
// Act
- r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreNETCoreTest.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreNETCoreTest.cs
index 95342d932c5..2d3744d7f0e 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreNETCoreTest.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreNETCoreTest.cs
@@ -26,7 +26,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -79,7 +78,7 @@ public async Task RestoreNetCore_AddExternalTargetVerifyTargetUsedAsync()
doc.Save(projectA.ProjectPath);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -116,7 +115,7 @@ public void RestoreNetCore_IfProjectsWitAndWithoutRestoreTargetsExistVerifyValid
File.WriteAllText(projectB.ProjectPath, "");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -149,7 +148,7 @@ public void RestoreNetCore_IfAllProjectsAreWithoutRestoreTargetsVerifySuccess()
File.WriteAllText(projectA.ProjectPath, "");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -470,14 +469,14 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
//Act
- var r1 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r1 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
//Assert.
Assert.Equal(0, r1.ExitCode);
Assert.Contains("Writing cache file", r1.Output);
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
//Assert.
Assert.Equal(0, r2.ExitCode);
@@ -512,7 +511,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(configPath, doc.ToString());
// Act
- var r3 = Util.RestoreSolution(pathContext, 0, _testOutputHelper, "-configFile", "NuGet.Config");
+ var r3 = Util.RestoreSolution(pathContext, 0, _testOutputHelper.WriteLine, "-configFile", "NuGet.Config");
//Assert.
@@ -551,14 +550,14 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
//Act
- var r1 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r1 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
//Assert.
Assert.Equal(0, r1.ExitCode);
Assert.Contains("Writing cache file", r1.Output);
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
//Assert.
Assert.Equal(0, r2.ExitCode);
@@ -594,7 +593,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(configPath, doc.ToString());
// Act
- var r3 = Util.RestoreSolution(pathContext, 0, testOutputHelper: _testOutputHelper, "-configFile", "NuGet.Config");
+ var r3 = Util.RestoreSolution(pathContext, 0, logLine: _testOutputHelper.WriteLine, "-configFile", "NuGet.Config");
//Assert.
@@ -633,14 +632,14 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
//Act
- var r1 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r1 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
//Assert.
Assert.Equal(0, r1.ExitCode);
Assert.Contains("Writing cache file", r1.Output);
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
//Assert.
Assert.Equal(0, r2.ExitCode);
@@ -673,7 +672,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(configPath, doc.ToString());
// Act
- var r3 = Util.RestoreSolution(pathContext, 0, testOutputHelper: _testOutputHelper, "-configFile", "NuGet.Config");
+ var r3 = Util.RestoreSolution(pathContext, 0, logLine: _testOutputHelper.WriteLine, "-configFile", "NuGet.Config");
//Assert.
@@ -714,7 +713,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var propsXML = XDocument.Load(projectA.PropsOutput);
var styleNode = propsXML.Root.Elements().First().Elements(XName.Get("NuGetProjectStyle", "http://schemas.microsoft.com/developer/msbuild/2003")).FirstOrDefault();
@@ -773,7 +772,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var propsXML = XDocument.Load(projectA.PropsOutput);
var styleNode = propsXML.Root.Elements().First().Elements(XName.Get("NuGetProjectStyle", "http://schemas.microsoft.com/developer/msbuild/2003")).FirstOrDefault();
@@ -837,7 +836,7 @@ public void RestoreNetCore_ProjectToProject_Recursive()
nugetexe,
pathContext.WorkingDirectory.Path,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
@@ -900,7 +899,7 @@ public void RestoreNetCore_ProjectToProject_RecursiveIgnoresNonRestorable()
nugetexe,
pathContext.WorkingDirectory.Path,
string.Join(" ", args),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(0 == r.ExitCode, r.Output + " " + r.Errors);
@@ -950,7 +949,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.AssetsFileOutputPath), r.Output);
@@ -1002,7 +1001,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var output = r.Output + " " + r.Errors;
// Assert
@@ -1047,7 +1046,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, r.ExitCode);
@@ -1092,7 +1091,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var output = r.Output + " " + r.Errors;
// Assert
@@ -1134,7 +1133,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.AssetsFileOutputPath), r.Output);
@@ -1183,7 +1182,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.AssetsFileOutputPath), r.Output);
@@ -1232,7 +1231,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var output = r.Output + r.Errors;
// Assert
@@ -1274,7 +1273,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.AssetsFileOutputPath), r.Output);
@@ -1352,7 +1351,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var zPath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
// Version should not be used
@@ -1428,7 +1427,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var zPath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
// Version should not be used
@@ -1439,7 +1438,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
Assert.Equal(testCount, Directory.GetDirectories(zPath).Length);
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
// Version should not be used
@@ -1495,7 +1494,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageZ);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, r.ExitCode);
@@ -1547,7 +1546,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.Equal(0, r.ExitCode);
Assert.True(File.Exists(project.PropsOutput), r.Output);
var propsXML = XDocument.Parse(File.ReadAllText(project.PropsOutput));
@@ -1599,7 +1598,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageZ);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, r.ExitCode);
@@ -1617,7 +1616,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
project2.Save();
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, r2.ExitCode);
@@ -1663,7 +1662,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, r.ExitCode);
@@ -1674,7 +1673,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
project.Save();
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, r2.ExitCode);
@@ -1733,7 +1732,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var zPath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(path), r.Output);
@@ -1791,7 +1790,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var path = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "1.0.0", "netcoreapp1.0", "project.assets.json");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(path), r.Output);
@@ -1861,20 +1860,20 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var cachePath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "2.0.0", "netcoreapp1.0", "z.nuget.cache");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
// This is expected, because despite the fact that both projects resolve to the same tool, the version range they request is different so they will keep overwriting each other
// Basically, it is impossible for both tools to no-op.
Assert.Contains($"Writing tool assets file to disk", r2.Output);
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
}
}
@@ -1942,13 +1941,13 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var cachePath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "2.0.0", "netcoreapp1.0", "z.nuget.cache");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
@@ -2030,7 +2029,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var cachePath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "2.5.0", "netcoreapp1.0", "z.nuget.cache");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
@@ -2046,7 +2045,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var cachePath20 = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "2.0.0", "netcoreapp1.0", "z.nuget.cache");
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
@@ -2109,19 +2108,19 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var cachePath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "1.0.0", "netcoreapp1.0", "z.nuget.cache");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
Assert.Contains($"The restore inputs for 'z-netcoreapp1.0-[1.0.0, )' have not changed. No further actions are required to complete the restore", r2.Output);
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
}
}
@@ -2181,7 +2180,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var path = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "1.0.0", "netcoreapp1.0", "project.assets.json");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(path), r.Output);
@@ -2244,19 +2243,19 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var cachePath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "1.0.0", "netcoreapp1.0", "z.nuget.cache");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
Assert.Contains($"The restore inputs for 'z-netcoreapp1.0-[1.0.0, )' have not changed. No further actions are required to complete the restore.", r2.Output);
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
}
}
@@ -2303,7 +2302,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Arrange
@@ -2367,13 +2366,13 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var cachePath = Path.Combine(pathContext.UserPackagesFolder, ".tools", "x", "1.0.0", "netcoreapp1.0", "x.nuget.cache");
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper, additionalArgs: "-Recursive");
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine, additionalArgs: "-Recursive");
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
// Act
- var r2 = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper, additionalArgs: "-Recursive");
+ var r2 = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine, additionalArgs: "-Recursive");
// Assert
Assert.True(File.Exists(assetsPath));
Assert.True(File.Exists(cachePath));
@@ -2381,7 +2380,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
Assert.Contains($"The restore inputs for 'a' have not changed. No further actions are required to complete the restore.", r2.Output);
Assert.Contains($"The restore inputs for 'b' have not changed. No further actions are required to complete the restore.", r2.Output);
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
}
}
@@ -2426,7 +2425,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var path = Path.Combine(pathContext.UserPackagesFolder, ".tools", "x", "1.0.0", "netcoreapp1.0", "project.assets.json");
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper, additionalArgs: "-Recursive");
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine, additionalArgs: "-Recursive");
// Assert
Assert.True(File.Exists(path), r.Output);
@@ -2474,7 +2473,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var path = Path.Combine(pathContext.UserPackagesFolder, ".tools", "x", "1.0.0", "netcoreapp1.0", "project.assets.json");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.False(File.Exists(path), r.Output);
@@ -2535,7 +2534,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var path = Path.Combine(pathContext.UserPackagesFolder, ".tools", "z", "1.0.0", "netcoreapp1.0", "project.assets.json");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains("WARNING: NU1604", r.AllOutput);
@@ -2612,7 +2611,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.TargetsOutput), r.Output);
@@ -2688,7 +2687,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.TargetsOutput), r.Output);
@@ -2738,7 +2737,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.TargetsOutput), r.Output);
@@ -2789,7 +2788,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var msbuildTargetsItems = TargetsUtility.GetMSBuildPackageImports(projectA.TargetsOutput);
var msbuildPropsItems = TargetsUtility.GetMSBuildPackageImports(projectA.PropsOutput);
@@ -2849,7 +2848,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var msbuildTargetsItems = TargetsUtility.GetMSBuildPackageImports(projectA.TargetsOutput);
var msbuildPropsItems = TargetsUtility.GetMSBuildPackageImports(projectA.PropsOutput);
@@ -2895,7 +2894,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Restore one
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var msbuildTargetsItems = TargetsUtility.GetMSBuildPackageImports(projectA.TargetsOutput);
var msbuildPropsItems = TargetsUtility.GetMSBuildPackageImports(projectA.PropsOutput);
@@ -2907,7 +2906,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectA.TargetsOutput), r.Output);
msbuildTargetsItems = TargetsUtility.GetMSBuildPackageImports(projectA.TargetsOutput);
@@ -2964,11 +2963,11 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Restore one
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectA.TargetsOutput), r.Output);
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.Equal(0, r.ExitCode);
Assert.True(File.Exists(projectA.TargetsOutput), r.Output);
}
@@ -3055,7 +3054,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targets = projectA.AssetsFile.Targets.Single(target => string.IsNullOrEmpty(target.RuntimeIdentifier)).Libraries.ToDictionary(e => e.Name);
@@ -3105,7 +3104,7 @@ public void RestoreNetCore_ProjectToProject_NETCoreToUnknown()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targetB = projectA.AssetsFile.Targets.Single(target => string.IsNullOrEmpty(target.RuntimeIdentifier)).Libraries.SingleOrDefault(e => e.Name == "b");
@@ -3152,7 +3151,7 @@ public void RestoreNetCore_ProjectToProject_NETCoreToUAP()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targetB = projectA.AssetsFile.Targets.Single(target => string.IsNullOrEmpty(target.RuntimeIdentifier)).Libraries.SingleOrDefault(e => e.Name == "b");
@@ -3218,7 +3217,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var tfm = NuGetFramework.Parse("UAP10.0");
@@ -3690,7 +3689,7 @@ public async Task RestoreNetCore_VerifyPropsAndTargetsAreWrittenWhenRestoreFails
// Act
// Verify failure
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
var targets = TargetsUtility.GetMSBuildPackageImports(projectA.TargetsOutput);
@@ -3734,7 +3733,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.AssetsFileOutputPath), r.Output);
@@ -3780,7 +3779,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var xTarget = projectA.AssetsFile.Targets.Single(target => string.IsNullOrEmpty(target.RuntimeIdentifier)).Libraries.Single();
// Assert
@@ -3824,7 +3823,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var xTarget = projectA.AssetsFile.Targets.Single(target => string.IsNullOrEmpty(target.RuntimeIdentifier)).Libraries.Single();
// Assert
@@ -3868,7 +3867,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(projectA.AssetsFileOutputPath), r.Output);
@@ -3898,7 +3897,7 @@ public void RestoreNetCore_SingleProject_NonNuGet()
// Act && Assert
// Verify this is a noop and not a failure
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
}
}
@@ -3929,7 +3928,7 @@ public void RestoreNetCore_NETCore_ProjectToProject_VerifyProjectInTarget()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targetB = projectA.AssetsFile.Targets.Single(target => string.IsNullOrEmpty(target.RuntimeIdentifier)).Libraries.SingleOrDefault(e => e.Name == "b");
@@ -3977,7 +3976,7 @@ public void RestoreNetCore_NETCore_ProjectToProject_VerifyPackageIdUsed()
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targetB = projectA.AssetsFile
@@ -4034,7 +4033,7 @@ public void RestoreNetCore_NETCore_ProjectToProject_IgnoreMissingProjectReferenc
// Act && Assert
// Missing projects are ignored during restore. These issues are reported at build time.
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
}
}
@@ -4079,7 +4078,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targetX = projectA.AssetsFile.Targets.Single(target => string.IsNullOrEmpty(target.RuntimeIdentifier)).Libraries.SingleOrDefault(e => e.Name == "x");
@@ -4141,7 +4140,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targetNet = projectA.AssetsFile.Targets.Single(e => e.TargetFramework.Equals(NuGetFramework.Parse("net46")) && string.IsNullOrEmpty(e.RuntimeIdentifier));
@@ -4196,7 +4195,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var targetNet = projectA.AssetsFile.Targets.Single(e => e.TargetFramework.Equals(NuGetFramework.Parse("net46")) && string.IsNullOrEmpty(e.RuntimeIdentifier));
@@ -4261,7 +4260,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
var xLibraryInA = projectA.AssetsFile.Libraries.Single(x => x.Name == packageX.Id);
@@ -4308,7 +4307,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var xLibrary = projectA.AssetsFile.Libraries.Single();
// Assert
@@ -4351,7 +4350,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var xLibrary = projectA.AssetsFile.Libraries.Single();
// Assert
@@ -4395,7 +4394,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
var graph = projectA.AssetsFile.GetTarget(netcoreapp2, runtimeIdentifier: null);
var lib = graph.GetTargetLibrary("x");
@@ -4452,7 +4451,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
foreach (var graph in projectA.AssetsFile.Targets)
@@ -4503,7 +4502,7 @@ public void RestoreNetCore_AssetTargetFallbackWithProjectReference_VerifyFallbac
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -4556,7 +4555,7 @@ public void RestoreNetCore_AssetTargetFallbackWithProjectReference_VerifyNoFallb
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -4599,7 +4598,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.AllOutput.Should().Contain("PackageTargetFallback and AssetTargetFallback cannot be used together.");
@@ -4684,7 +4683,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageZ);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
projectA.AssetsFile.Libraries.Select(e => e.Name).OrderBy(e => e).Should().BeEquivalentTo(new[] { "m", "x", "y", "z" });
@@ -4746,7 +4745,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
projectA.AssetsFile.Libraries.Select(e => e.Name).OrderBy(e => e).Should().BeEquivalentTo(new[] { "x", "y" });
@@ -4808,7 +4807,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
projectA.AssetsFile.Libraries.Select(e => e.Name).OrderBy(e => e).Should().BeEquivalentTo(new[] { "x", "y" });
@@ -4873,7 +4872,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
projectA.AssetsFile.Libraries.Select(e => e.Name).OrderBy(e => e).Should().BeEquivalentTo(new[] { "x", "y" });
@@ -4922,7 +4921,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
projectA.AssetsFile.Libraries.Select(e => e.Name).OrderBy(e => e).Should().BeEquivalentTo(new[] { "x" });
@@ -4970,7 +4969,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
projectA.AssetsFile.Libraries.Select(e => e.Name).OrderBy(e => e).Should().BeEquivalentTo(new[] { "x" });
@@ -5019,7 +5018,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var unexpectedFolder = Path.Combine(Path.GetDirectoryName(projectA.ProjectPath), "invalid");
// Act
- var r = Util.RestoreSolution(pathContext, 0, testOutputHelper: _testOutputHelper, "-PackagesDirectory", "pkgs");
+ var r = Util.RestoreSolution(pathContext, 0, logLine: _testOutputHelper.WriteLine, "-PackagesDirectory", "pkgs");
// Assert
Directory.GetDirectories(expectedFolder).Should().NotBeEmpty();
@@ -5111,7 +5110,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageZ);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Directory.Exists(new ToolPathResolver(pathContext.UserPackagesFolder).GetToolDirectoryPath(packageM.Id, NuGetVersion.Parse(packageM.Version), netcoreapp2));
@@ -5160,7 +5159,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var expectedFolder = Path.Combine(Path.GetDirectoryName(projectA.ProjectPath), "valid");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Directory.GetDirectories(expectedFolder).Should().NotBeEmpty();
@@ -5227,7 +5226,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -5271,7 +5270,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -5317,7 +5316,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, 0, testOutputHelper: _testOutputHelper, "-Source", relativeSourceName);
+ var r = Util.RestoreSolution(pathContext, 0, logLine: _testOutputHelper.WriteLine, "-Source", relativeSourceName);
// Assert
r.Success.Should().BeTrue();
@@ -5362,7 +5361,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -5434,7 +5433,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(configPath, doc.ToString());
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r2.Success.Should().BeTrue();
@@ -5529,7 +5528,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(configPath2, doc2.ToString());
// Act
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r2.Success.Should().BeTrue();
@@ -5582,7 +5581,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var relativePathToConfig = PathUtility.GetRelativePath(pathContext.WorkingDirectory + Path.DirectorySeparatorChar, configPath);
// Act
- var r = Util.RestoreSolution(pathContext, 0, testOutputHelper: _testOutputHelper, $"-ConfigFile {relativePathToConfig}");
+ var r = Util.RestoreSolution(pathContext, 0, logLine: _testOutputHelper.WriteLine, $"-ConfigFile {relativePathToConfig}");
// Assert
Assert.True(File.Exists(projectA.AssetsFileOutputPath), r.Output);
@@ -5649,14 +5648,14 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act && Assert
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
Assert.Equal(0, r.ExitCode);
Assert.Contains("Writing cache file", r.Output);
// Do it again, it should no-op now.
// Act && Assert
- var r2 = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
Assert.Equal(0, r2.ExitCode);
Assert.DoesNotContain("Writing cache file", r2.Output);
@@ -5696,7 +5695,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act && Assert
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
Assert.Equal(0, r.ExitCode);
Assert.Contains("Writing cache file", r.Output);
@@ -5706,7 +5705,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
Assert.True(File.Exists(project.CacheFileOutputPath));
File.Delete(project.CacheFileOutputPath);
- r = Util.RestoreSolution(pathContext, expectedExitCode: 0, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine);
Assert.Equal(0, r.ExitCode);
Assert.Contains("Writing cache file", r.Output);
@@ -5748,7 +5747,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -5845,7 +5844,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -5908,7 +5907,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -5917,7 +5916,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
Assert.True(File.Exists(projectA.NuGetLockFileOutputPath));
// Second Restore
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -5952,7 +5951,7 @@ public void RestoreNetCore_PackagesLockFile_LowercaseProjectNameSolutionRestore(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -6053,7 +6052,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -6115,7 +6114,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -6482,7 +6481,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -6536,7 +6535,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -6605,7 +6604,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
xml.Save(projectA.ProjectPath);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -6665,7 +6664,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -6730,7 +6729,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -6802,7 +6801,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
xml.Save(projectA.ProjectPath);
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.False(r.Success, r.AllOutput);
@@ -6842,7 +6841,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Projects.Add(projectA);
solution.Create();
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Preconditions
Assert.True(r.Success, r.AllOutput);
@@ -6861,7 +6860,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.True(r.Success, r.AllOutput);
Assert.True(Directory.Exists(packagePath), $"{packageX.ToString()} is not installed");
@@ -6900,7 +6899,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Projects.Add(projectA);
solution.Create();
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Preconditions
Assert.True(r.Success, r.AllOutput);
@@ -6916,7 +6915,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.True(r.Success, r.AllOutput);
Assert.True(Directory.Exists(packagePath), $"{packageX.ToString()} is not installed");
@@ -6961,7 +6960,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -7025,7 +7024,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -7099,7 +7098,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
xml.Save(projectB.ProjectPath);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -7190,7 +7189,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
xml.Save(projectA.ProjectPath);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(r.Success, r.AllOutput);
@@ -7307,7 +7306,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act & Assert
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU1213.GetName(), r.AllOutput);
}
}
@@ -7345,7 +7344,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7362,7 +7361,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projectA.Save();
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7413,7 +7412,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7433,7 +7432,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projectB.Save();
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7489,7 +7488,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7509,7 +7508,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.Delete(projectA.AssetsFileOutputPath);
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7562,7 +7561,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7582,7 +7581,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.Delete(projectA.AssetsFileOutputPath);
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7629,7 +7628,7 @@ public void RestoreNetCore_PackagesLockFile_ProjectReferenceChange_UpdatesLockFi
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7654,7 +7653,7 @@ public void RestoreNetCore_PackagesLockFile_ProjectReferenceChange_UpdatesLockFi
projectA.Save();
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7716,7 +7715,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7739,7 +7738,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projectA.Save();
// Act
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7793,7 +7792,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
doc.Save(projectA.ProjectPath);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7861,7 +7860,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -7908,7 +7907,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(projectA.NuGetLockFileOutputPath, "");
// Act
- var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeFalse();
@@ -7961,7 +7960,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -7981,7 +7980,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.Delete(projectA.CacheFileOutputPath);
// Act
- result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -8032,7 +8031,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -8094,7 +8093,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var result = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ var result = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeFalse();
@@ -8148,7 +8147,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var commandRunnerResult = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var commandRunnerResult = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
commandRunnerResult.Success.Should().BeTrue();
@@ -8172,7 +8171,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projectA.Save();
// Act & Assert
- commandRunnerResult = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ commandRunnerResult = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
commandRunnerResult.Success.Should().BeTrue();
commandRunnerResult.AllOutput.Contains("Writing cache file");
Assert.True(File.Exists(projectA.AssetsFileOutputPath));
@@ -8193,7 +8192,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projectA.Save();
// Act & Assert. The result should not be affected by the runtime json change.
- commandRunnerResult = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ commandRunnerResult = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
commandRunnerResult.Success.Should().BeTrue();
Assert.Contains("No-Op restore", commandRunnerResult.AllOutput);
Assert.True(File.Exists(projectA.AssetsFileOutputPath));
@@ -8238,7 +8237,7 @@ public void RestoreNetCore_PackagesLockFile_WithProjectChangeRuntimeAndLockedMod
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8295,7 +8294,7 @@ public void RestoreNetCore_PackagesLockFile_WithProjectChangeFramweorksAndLocked
_testOutputHelper.WriteLine($"InputFrameworks: {string.Join(",", lockFrameworkTransformed)}");
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8377,7 +8376,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8478,7 +8477,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8556,7 +8555,7 @@ public void RestoreNetCore_PackagesLockFile_WithDependentProjectChangeOfNotCompa
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8614,7 +8613,7 @@ public void RestoreNetCore_PackagesLockFile_WithDependentProjectChangeOfCompatib
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8686,7 +8685,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectA.NuGetLockFileOutputPath));
@@ -8715,7 +8714,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
//Run the restore and it should still properly restore.
- var r2 = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r2 = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8763,7 +8762,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -8813,7 +8812,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -8825,7 +8824,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projectA.Save();
// Act
- result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -8865,7 +8864,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -8942,7 +8941,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -8950,7 +8949,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
Assert.True(File.Exists(projectA.NuGetLockFileOutputPath));
// Second Restore
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Update the cpvm
cpvmFile.SetPackageVersion("x", "2.0.0");
@@ -9027,7 +9026,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9102,7 +9101,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9176,7 +9175,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9249,7 +9248,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9332,7 +9331,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9344,7 +9343,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
cpvmFile.Save();
// the addition should not impact this restore
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9354,7 +9353,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
cpvmFile.Save();
// the removal should not impact this restore
- r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9449,7 +9448,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.CentralPackageVersionsManagementFile = cpvmFile;
solution.Create();
- var restoreResult = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var restoreResult = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.True(restoreResult.AllOutput.Contains("NU1605"));
}
@@ -9641,7 +9640,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9694,7 +9693,7 @@ public void RestoreNetCore_WithMultipleFrameworksWithPlatformAndAssetTargetFallb
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9739,7 +9738,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
Assert.Equal(0, r.ExitCode);
Assert.True(File.Exists(project.PropsOutput), r.Output);
var propsXML = XDocument.Parse(File.ReadAllText(project.PropsOutput));
@@ -9803,7 +9802,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -9868,7 +9867,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- CommandRunnerResult result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -9926,7 +9925,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- CommandRunnerResult result = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -10001,7 +10000,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- var r = Util.RestoreSolution(pathContext, testOutputHelper: _testOutputHelper);
+ var r = Util.RestoreSolution(pathContext, logLine: _testOutputHelper.WriteLine);
// Assert
r.Success.Should().BeTrue();
@@ -10083,7 +10082,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Create();
// Act
- CommandRunnerResult result = Util.RestoreSolution(pathContext, expectedExitCode: 1, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = Util.RestoreSolution(pathContext, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeFalse();
@@ -10842,7 +10841,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
};
// Act
- var r = Util.Restore(pathContext, projectA.ProjectPath, expectedExitCode: 0, testOutputHelper: _testOutputHelper, args);
+ var r = Util.Restore(pathContext, projectA.ProjectPath, expectedExitCode: 0, logLine: _testOutputHelper.WriteLine, args);
// Assert
// If we pass source then log include actual path to repository instead of repository name.
@@ -10936,7 +10935,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
};
// Act
- var r = Util.Restore(pathContext, projectA.ProjectPath, expectedExitCode: 1, testOutputHelper: _testOutputHelper, args);
+ var r = Util.Restore(pathContext, projectA.ProjectPath, expectedExitCode: 1, logLine: _testOutputHelper.WriteLine, args);
// Assert
Assert.Contains("Package source mapping match not found for package ID 'Contoso.MVC.ASP'.", r.Output);
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/Util.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/Util.cs
index fc369cf136a..508d1fa03d3 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/Util.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/Util.cs
@@ -24,7 +24,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Test
{
@@ -50,15 +49,15 @@ public static string GetResource(string name)
///
/// Restore a solution.
///
- public static CommandRunnerResult RestoreSolution(SimpleTestPathContext pathContext, int expectedExitCode = 0, ITestOutputHelper testOutputHelper = null, params string[] additionalArgs)
+ public static CommandRunnerResult RestoreSolution(SimpleTestPathContext pathContext, int expectedExitCode = 0, Action logLine = null, params string[] additionalArgs)
{
- return Restore(pathContext, pathContext.SolutionRoot, expectedExitCode, testOutputHelper, additionalArgs);
+ return Restore(pathContext, pathContext.SolutionRoot, expectedExitCode, logLine, additionalArgs);
}
///
/// Run nuget.exe restore {inputPath}
///
- public static CommandRunnerResult Restore(SimpleTestPathContext pathContext, string inputPath, int expectedExitCode = 0, ITestOutputHelper testOutputHelper = null, params string[] additionalArgs)
+ public static CommandRunnerResult Restore(SimpleTestPathContext pathContext, string inputPath, int expectedExitCode = 0, Action logLine = null, params string[] additionalArgs)
{
var nugetExe = GetNuGetExePath();
@@ -72,10 +71,10 @@ public static CommandRunnerResult Restore(SimpleTestPathContext pathContext, str
args = args.Concat(additionalArgs).ToArray();
- return RunCommand(pathContext, nugetExe, expectedExitCode, testOutputHelper, args);
+ return RunCommand(pathContext, nugetExe, expectedExitCode, logLine, args);
}
- public static CommandRunnerResult RunCommand(SimpleTestPathContext pathContext, string nugetExe, int expectedExitCode = 0, ITestOutputHelper testOutputHelper = null, params string[] arguments)
+ public static CommandRunnerResult RunCommand(SimpleTestPathContext pathContext, string nugetExe, int expectedExitCode = 0, Action logLine = null, params string[] arguments)
{
// Store the dg file for debugging
var dgPath = Path.Combine(pathContext.WorkingDirectory, "out.dg");
@@ -91,7 +90,7 @@ public static CommandRunnerResult RunCommand(SimpleTestPathContext pathContext,
pathContext.WorkingDirectory.Path,
string.Join(" ", arguments),
environmentVariables: envVars,
- testOutputHelper: testOutputHelper);
+ logLine: logLine);
// Assert
Assert.True(expectedExitCode == r.ExitCode, r.Errors + "\n\n" + r.Output);
diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/XunitAttribute.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/XunitAttribute.cs
index ae1717c519f..e7fc18d092c 100644
--- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/XunitAttribute.cs
+++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/XunitAttribute.cs
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.CompilerServices;
using NuGet.Common;
using Xunit;
@@ -10,7 +11,10 @@ namespace NuGet.CommandLine.Test
public class WindowsNTFactAttribute
: FactAttribute
{
- public WindowsNTFactAttribute()
+ public WindowsNTFactAttribute(
+ [CallerFilePath] string? sourceFilePath = null,
+ [CallerLineNumber] int sourceLineNumber = 0)
+ : base(sourceFilePath, sourceLineNumber)
{
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
{
@@ -22,7 +26,10 @@ public WindowsNTFactAttribute()
public class UnixMonoFactAttribute
: FactAttribute
{
- public UnixMonoFactAttribute()
+ public UnixMonoFactAttribute(
+ [CallerFilePath] string? sourceFilePath = null,
+ [CallerLineNumber] int sourceLineNumber = 0)
+ : base(sourceFilePath, sourceLineNumber)
{
if (!RuntimeEnvironmentHelper.IsMono || RuntimeEnvironmentHelper.IsWindows)
{
@@ -34,7 +41,10 @@ public UnixMonoFactAttribute()
public class SkipMonoAttribute
: FactAttribute
{
- public SkipMonoAttribute()
+ public SkipMonoAttribute(
+ [CallerFilePath] string? sourceFilePath = null,
+ [CallerLineNumber] int sourceLineNumber = 0)
+ : base(sourceFilePath, sourceLineNumber)
{
if (RuntimeEnvironmentHelper.IsMono)
{
@@ -46,7 +56,10 @@ public SkipMonoAttribute()
public class SkipMonoTheoryAttribute
: TheoryAttribute
{
- public SkipMonoTheoryAttribute()
+ public SkipMonoTheoryAttribute(
+ [CallerFilePath] string? sourceFilePath = null,
+ [CallerLineNumber] int sourceLineNumber = 0)
+ : base(sourceFilePath, sourceLineNumber)
{
if (RuntimeEnvironmentHelper.IsMono)
{
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/NuGet.PackageManagement.UI.Test.csproj b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/NuGet.PackageManagement.UI.Test.csproj
index b29a1f67eb0..19639a1f215 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/NuGet.PackageManagement.UI.Test.csproj
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/NuGet.PackageManagement.UI.Test.csproj
@@ -17,7 +17,8 @@
-
+
+
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/TestNuGetUILogger.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/TestNuGetUILogger.cs
index 94763a21c32..9a7698a0fce 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/TestNuGetUILogger.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/TestNuGetUILogger.cs
@@ -5,7 +5,7 @@
using NuGet.Common;
using NuGet.PackageManagement.VisualStudio;
using NuGet.ProjectManagement;
-using Xunit.Abstractions;
+using Xunit;
namespace NuGet.PackageManagement.UI.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/ClearNuGetLocalsViewModelTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/ClearNuGetLocalsViewModelTests.cs
index 4e6d8d2eef3..0352f2fb212 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/ClearNuGetLocalsViewModelTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/ClearNuGetLocalsViewModelTests.cs
@@ -25,7 +25,7 @@ public void Constructor_WithNullClearNuGetLocalsCommandExecute_ThrowsArgumentNul
Assert.Throws(() => new ClearNuGetLocalsViewModel(clearNuGetLocalsCommandExecute: null!));
}
- [Fact]
+ [WpfFact]
public async Task Execute_TaskCompletedSuccessfully_PropertiesUpdated()
{
ClearNuGetLocalsViewModel viewModel = new ClearNuGetLocalsViewModel(clearNuGetLocalsCommandExecute: ClearNuGetLocalsCommandSuccessOnExecute);
@@ -34,7 +34,7 @@ public async Task Execute_TaskCompletedSuccessfully_PropertiesUpdated()
viewModel.CommandCompleteText.Should().Contain("NuGet storage cleared at");
}
- [Fact]
+ [WpfFact]
public async Task Execute_TaskFailedWithError_PropertiesUpdated()
{
ClearNuGetLocalsViewModel viewModel = new ClearNuGetLocalsViewModel(clearNuGetLocalsCommandExecute: ClearNuGetLocalsCommandErrorOnExecute);
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/PackageItemViewModelTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/PackageItemViewModelTests.cs
index 8163621e0cc..0ef3cd1bf9e 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/PackageItemViewModelTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/ViewModels/PackageItemViewModelTests.cs
@@ -26,7 +26,6 @@
using NuGet.VisualStudio.Telemetry;
using Test.Utility.Threading;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.UI.Test.ViewModels
{
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfFactAttribute.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfFactAttribute.cs
deleted file mode 100644
index 1a5b5c22362..00000000000
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfFactAttribute.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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 Xunit;
-using Xunit.Sdk;
-
-namespace NuGet.PackageManagement.UI.Test
-{
- [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
- [XunitTestCaseDiscoverer("NuGet.PackageManagement.UI.Test.WpfFactDiscoverer", "NuGet.PackageManagement.UI.Test")]
- public sealed class WpfFactAttribute : FactAttribute
- {
- }
-}
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfFactDiscoverer.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfFactDiscoverer.cs
deleted file mode 100644
index 5988060b3fd..00000000000
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfFactDiscoverer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// 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.Collections.Generic;
-using System.Linq;
-using Xunit.Abstractions;
-using Xunit.Sdk;
-
-namespace NuGet.PackageManagement.UI.Test
-{
- public sealed class WpfFactDiscoverer : IXunitTestCaseDiscoverer
- {
- private readonly FactDiscoverer _factDiscoverer;
-
- public WpfFactDiscoverer(IMessageSink diagnosticMessageSink)
- {
- _factDiscoverer = new FactDiscoverer(diagnosticMessageSink);
- }
-
- public IEnumerable Discover(
- ITestFrameworkDiscoveryOptions discoveryOptions,
- ITestMethod testMethod,
- IAttributeInfo factAttribute)
- {
- return _factDiscoverer.Discover(discoveryOptions, testMethod, factAttribute)
- .Select(testCase => new WpfTestCase(testCase));
- }
- }
-}
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTestCase.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTestCase.cs
deleted file mode 100644
index d0396567f7c..00000000000
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTestCase.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-// 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.
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Threading;
-using Xunit;
-using Xunit.Abstractions;
-using Xunit.Sdk;
-
-namespace NuGet.PackageManagement.UI.Test
-{
- [DebuggerDisplay(@"\{ class = {TestMethod.TestClass.Class.Name}, method = {TestMethod.Method.Name}, display = {DisplayName}, skip = {SkipReason} \}")]
- public sealed class WpfTestCase : LongLivedMarshalByRefObject, IXunitTestCase
- {
- private IXunitTestCase _testCase;
-
- public string DisplayName => _testCase.DisplayName;
- public IMethodInfo Method => _testCase.Method;
- public string SkipReason => _testCase.SkipReason;
- public ITestMethod TestMethod => _testCase.TestMethod;
- public object[] TestMethodArguments => _testCase.TestMethodArguments;
- public Dictionary> Traits => _testCase.Traits;
- public string UniqueID => _testCase.UniqueID;
-
- public ISourceInformation SourceInformation
- {
- get => _testCase.SourceInformation;
- set => _testCase.SourceInformation = value;
- }
-
- public Exception InitializationException => _testCase.InitializationException;
-
- public int Timeout => _testCase.Timeout;
-
- public WpfTestCase(IXunitTestCase testCase)
- {
- if (testCase == null)
- {
- throw new ArgumentNullException(nameof(testCase));
- }
-
- _testCase = testCase;
- }
-
- [Obsolete("Called by the deserializer", error: true)]
- public WpfTestCase() { }
-
- public Task RunAsync(IMessageSink diagnosticMessageSink,
- IMessageBus messageBus,
- object[] constructorArguments,
- ExceptionAggregator aggregator,
- CancellationTokenSource cancellationTokenSource)
- {
- var taskCompletionSource = new TaskCompletionSource();
- var thread = new Thread(() =>
- {
- try
- {
- // Set up the SynchronizationContext so that any awaits
- // resume on the STA thread as they would in a GUI app.
- SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());
-
- // Start off the test method.
- var testCaseTask = _testCase.RunAsync(diagnosticMessageSink, messageBus, constructorArguments, aggregator, cancellationTokenSource);
-
- // Arrange to pump messages to execute any async work associated with the test.
- var frame = new DispatcherFrame();
- _ = Task.Run(async delegate
- {
- try
- {
- await testCaseTask;
- }
- finally
- {
- // The test case's execution is done. Terminate the message pump.
- frame.Continue = false;
- }
- });
- Dispatcher.PushFrame(frame);
-
- // Report the result back to the Task we returned earlier.
- CopyTaskResultFrom(taskCompletionSource, testCaseTask);
- }
- catch (Exception e)
- {
- taskCompletionSource.SetException(e);
- }
- finally
- {
- Dispatcher.CurrentDispatcher.InvokeShutdown();
- }
- });
-
- thread.SetApartmentState(ApartmentState.STA);
- thread.Start();
-
- return taskCompletionSource.Task;
- }
-
- public void Deserialize(IXunitSerializationInfo info)
- {
- _testCase = info.GetValue("InnerTestCase");
- }
-
- public void Serialize(IXunitSerializationInfo info)
- {
- info.AddValue("InnerTestCase", _testCase);
- }
-
- private static void CopyTaskResultFrom(TaskCompletionSource taskCompletionSource, Task template)
- {
- if (taskCompletionSource == null)
- {
- throw new ArgumentNullException(nameof(taskCompletionSource));
- }
-
- if (template == null)
- {
- throw new ArgumentNullException(nameof(template));
- }
-
- if (!template.IsCompleted)
- {
- throw new ArgumentException("Task must be completed first.", nameof(template));
- }
-
- if (template.IsFaulted)
- {
- taskCompletionSource.SetException(template.Exception);
- }
- else if (template.IsCanceled)
- {
- taskCompletionSource.SetCanceled();
- }
- else
- {
- taskCompletionSource.SetResult(template.Result);
- }
- }
- }
-}
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTheoryAttribute.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTheoryAttribute.cs
deleted file mode 100644
index 8dc601435d0..00000000000
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTheoryAttribute.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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 Xunit;
-using Xunit.Sdk;
-
-namespace NuGet.PackageManagement.UI.Test
-{
- [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
- [XunitTestCaseDiscoverer("NuGet.PackageManagement.UI.Test.WpfTheoryDiscoverer", "NuGet.PackageManagement.UI.Test")]
- public sealed class WpfTheoryAttribute : TheoryAttribute
- {
- }
-}
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTheoryDiscoverer.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTheoryDiscoverer.cs
deleted file mode 100644
index 8ef9abb2a3f..00000000000
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/WpfTheoryDiscoverer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// 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.Collections.Generic;
-using System.Linq;
-using Xunit.Abstractions;
-using Xunit.Sdk;
-
-namespace NuGet.PackageManagement.UI.Test
-{
- public sealed class WpfTheoryDiscoverer : IXunitTestCaseDiscoverer
- {
- private readonly TheoryDiscoverer _theoryDiscoverer;
-
- public WpfTheoryDiscoverer(IMessageSink diagnosticMessageSink)
- {
- _theoryDiscoverer = new TheoryDiscoverer(diagnosticMessageSink);
- }
-
- public IEnumerable Discover(
- ITestFrameworkDiscoveryOptions discoveryOptions,
- ITestMethod testMethod,
- IAttributeInfo factAttribute)
- {
- return _theoryDiscoverer.Discover(discoveryOptions, testMethod, factAttribute)
- .Select(testCase => new WpfTestCase(testCase));
- }
- }
-}
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Xamls/InfiniteScrollListTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Xamls/InfiniteScrollListTests.cs
index ce5b3099e0d..67ddfab604d 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Xamls/InfiniteScrollListTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Xamls/InfiniteScrollListTests.cs
@@ -18,7 +18,6 @@
using NuGet.VisualStudio;
using NuGet.VisualStudio.Internal.Contracts;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.UI.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/CpsPackageReferenceProjectTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/CpsPackageReferenceProjectTests.cs
index 2e0aa7c2bbf..887fb72c97e 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/CpsPackageReferenceProjectTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/CpsPackageReferenceProjectTests.cs
@@ -33,7 +33,6 @@
using Test.Utility;
using Test.Utility.VisualStudio;
using Xunit;
-using Xunit.Abstractions;
using static NuGet.PackageManagement.VisualStudio.Test.ProjectFactories;
namespace NuGet.PackageManagement.VisualStudio.Test
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/ConsolidatePackageFeedTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/ConsolidatePackageFeedTests.cs
index 3534171c9e4..74047e8d862 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/ConsolidatePackageFeedTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/ConsolidatePackageFeedTests.cs
@@ -13,7 +13,6 @@
using NuGet.Test.Utility;
using NuGet.Versioning;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.VisualStudio.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/InstalledAndTransitivePackageFeedTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/InstalledAndTransitivePackageFeedTests.cs
index 9811b5ce902..d3c321d354d 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/InstalledAndTransitivePackageFeedTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/InstalledAndTransitivePackageFeedTests.cs
@@ -17,7 +17,6 @@
using NuGet.Versioning;
using NuGet.VisualStudio.Internal.Contracts;
using Xunit;
-using Xunit.Abstractions;
using static NuGet.Protocol.Core.Types.PackageSearchMetadataBuilder;
namespace NuGet.PackageManagement.VisualStudio.Test
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/RecommenderPackageFeedTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/RecommenderPackageFeedTests.cs
index cb5c8382933..d1620647723 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/RecommenderPackageFeedTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Feeds/RecommenderPackageFeedTests.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using Moq;
-using Xunit.Abstractions;
using Xunit;
using NuGet.Test.Utility;
using NuGet.Protocol.Core.Types;
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/NuGet.PackageManagement.VisualStudio.Test.csproj b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/NuGet.PackageManagement.VisualStudio.Test.csproj
index 764fa3738fd..c1a259026ce 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/NuGet.PackageManagement.VisualStudio.Test.csproj
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/NuGet.PackageManagement.VisualStudio.Test.csproj
@@ -29,6 +29,6 @@
-
+
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/ProjectFactories.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/ProjectFactories.cs
index d63136aebc4..877d0fc9a0d 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/ProjectFactories.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/ProjectFactories.cs
@@ -21,7 +21,6 @@
using NuGet.VisualStudio;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.VisualStudio.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/NuGetProjectManagerServiceTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/NuGetProjectManagerServiceTests.cs
index 4b91b0f48e3..8c7f77273f7 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/NuGetProjectManagerServiceTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/NuGetProjectManagerServiceTests.cs
@@ -42,7 +42,6 @@
using Test.Utility;
using Test.Utility.VisualStudio;
using Xunit;
-using Xunit.Abstractions;
using static NuGet.PackageManagement.VisualStudio.Test.ProjectFactories;
using PackageReference = NuGet.Packaging.PackageReference;
using Task = System.Threading.Tasks.Task;
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/PackageVulnerabilityServiceTests.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/PackageVulnerabilityServiceTests.cs
index a7dccbb1bef..578573c9222 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/PackageVulnerabilityServiceTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Services/PackageVulnerabilityServiceTests.cs
@@ -15,7 +15,6 @@
using NuGet.Versioning;
using NuGet.VisualStudio.Internal.Contracts;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.VisualStudio.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/TestNuGetUILogger.cs b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/TestNuGetUILogger.cs
index 040733a6e0e..eb988a1483f 100644
--- a/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/TestNuGetUILogger.cs
+++ b/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/TestNuGetUILogger.cs
@@ -4,7 +4,7 @@
using System;
using NuGet.Common;
using NuGet.ProjectManagement;
-using Xunit.Abstractions;
+using Xunit;
namespace NuGet.PackageManagement.VisualStudio.Test
{
diff --git a/test/NuGet.Clients.Tests/NuGet.SolutionRestoreManager.Test/NuGet.SolutionRestoreManager.Test.csproj b/test/NuGet.Clients.Tests/NuGet.SolutionRestoreManager.Test/NuGet.SolutionRestoreManager.Test.csproj
index bb7ac28e4a1..cd1c63e2fcb 100644
--- a/test/NuGet.Clients.Tests/NuGet.SolutionRestoreManager.Test/NuGet.SolutionRestoreManager.Test.csproj
+++ b/test/NuGet.Clients.Tests/NuGet.SolutionRestoreManager.Test/NuGet.SolutionRestoreManager.Test.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/test/NuGet.Clients.Tests/NuGet.Tools.Test/NuGet.Tools.Test.csproj b/test/NuGet.Clients.Tests/NuGet.Tools.Test/NuGet.Tools.Test.csproj
index 16b5235c28f..756428c90e0 100644
--- a/test/NuGet.Clients.Tests/NuGet.Tools.Test/NuGet.Tools.Test.csproj
+++ b/test/NuGet.Clients.Tests/NuGet.Tools.Test/NuGet.Tools.Test.csproj
@@ -1,4 +1,4 @@
-
+
$(NETFXTargetFramework)
Unit tests for NuGet.Tools.
@@ -10,6 +10,6 @@
-
+
diff --git a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/NuGet.VisualStudio.Common.Test.csproj b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/NuGet.VisualStudio.Common.Test.csproj
index b1ebf5a75fc..176aa2a0755 100644
--- a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/NuGet.VisualStudio.Common.Test.csproj
+++ b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/NuGet.VisualStudio.Common.Test.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/OutputConsoleLoggerTests.cs b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/OutputConsoleLoggerTests.cs
index d1e47a82e82..605cfd756ca 100644
--- a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/OutputConsoleLoggerTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/OutputConsoleLoggerTests.cs
@@ -70,9 +70,9 @@ void IDisposable.Dispose()
_outputConsoleLogger.Dispose();
}
- public Task DisposeAsync() => Task.CompletedTask;
+ public ValueTask DisposeAsync() => default;
- public async Task InitializeAsync()
+ public async ValueTask InitializeAsync()
{
await WaitForInitializationAsync();
}
diff --git a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGet.VisualStudio.Implementation.Test.csproj b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGet.VisualStudio.Implementation.Test.csproj
index 45e37e0b28d..11982c1d6e4 100644
--- a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGet.VisualStudio.Implementation.Test.csproj
+++ b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGet.VisualStudio.Implementation.Test.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGetProjectServiceV1ContractTests.cs b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGetProjectServiceV1ContractTests.cs
index a8923ca1a46..1b59ef5e85a 100644
--- a/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGetProjectServiceV1ContractTests.cs
+++ b/test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGetProjectServiceV1ContractTests.cs
@@ -7,7 +7,6 @@
using Microsoft.VisualStudio.Sdk.TestFramework;
using NuGet.VisualStudio.Contracts;
using Xunit;
-using Xunit.Abstractions;
public class NuGetProjectServiceV1ContractTests : BrokeredServiceContractTestBase
{
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetAddPackageTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetAddPackageTests.cs
index cc70be3db0c..9282372fb3d 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetAddPackageTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetAddPackageTests.cs
@@ -19,7 +19,6 @@
using NuGet.XPlat.FuncTest;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
using Strings = NuGet.Packaging.Strings;
namespace Dotnet.Integration.Test
@@ -63,7 +62,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectFilePath = Path.Combine(projectDirectory, $"{projectName}.csproj");
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath}", logLine: _testOutputHelper.WriteLine);
// Assert
// Make sure source is replaced in generated dgSpec file.
@@ -100,10 +99,10 @@ public async Task AddPkg_FileBasedApp()
// Generate DG file.
var dgFile = Path.Join(tempDir, "dg.json");
- _fixture.RunDotnetExpectSuccess(fbaDir, $"build app.cs -t:GenerateRestoreGraphFile -p:RestoreGraphOutputPath={ArgumentEscaper.EscapeAndConcatenate([dgFile])}", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(fbaDir, $"build app.cs -t:GenerateRestoreGraphFile -p:RestoreGraphOutputPath={ArgumentEscaper.EscapeAndConcatenate([dgFile])}", logLine: _testOutputHelper.WriteLine);
// Get project content.
- var virtualProject = _fixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper);
+ var virtualProject = _fixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper.WriteLine);
_testOutputHelper.WriteLine("before:\n" + virtualProject.Content);
Assert.DoesNotContain("PackageReference", virtualProject.Content);
using var builder = new TestVirtualProjectBuilder(virtualProject);
@@ -173,7 +172,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectFilePath = Path.Combine(projectDirectory, $"{projectName}.csproj");
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectFailure(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectFailure(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath}", logLine: _testOutputHelper.WriteLine);
}
}
@@ -204,7 +203,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectFilePath = Path.Combine(projectDirectory, $"{projectName}.csproj");
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath} -v {packageX_V1.Version}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath} -v {packageX_V1.Version}", logLine: _testOutputHelper.WriteLine);
// Assert
// Make sure source is replaced in generated dgSpec file.
@@ -246,7 +245,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectFilePath = Path.Combine(projectDirectory, $"{projectName}.csproj");
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectFailure(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath} -v {packageX_V2.Version}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectFailure(projectDirectory, $"add {projectFilePath} package {packageX} -s {sourceRelativePath} -v {packageX_V2.Version}", logLine: _testOutputHelper.WriteLine);
}
}
@@ -275,7 +274,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectFilePath = Path.Combine(projectDirectory, $"{projectName}.csproj");
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(projectDirectory, $"add {projectFilePath} package {packageY}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(projectDirectory, $"add {projectFilePath} package {packageY}", logLine: _testOutputHelper.WriteLine);
// Assert
@@ -346,7 +345,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(projectADirectory, "NuGet.Config"), configFile);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains($"Installed {packageX} {version} from {packageSource2.FullName}", result.AllOutput);
@@ -409,7 +408,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(projectADirectory, "NuGet.Config"), configFile);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains($"Installed {packageX} {version} from {packageSource2.FullName}", result.AllOutput);
@@ -474,7 +473,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(projectADirectory, "NuGet.Config"), configFile);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version} -s {pathContext.PackageSource}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version} -s {pathContext.PackageSource}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains($"Installed {packageX} {version} from {pathContext.PackageSource}", result.AllOutput);
@@ -538,7 +537,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(projectADirectory, "NuGet.Config"), configFile);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version} -s {packageSource2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version} -s {packageSource2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains($"Installed {packageX} {version} from {packageSource2}", result.AllOutput);
@@ -606,7 +605,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(projectADirectory, "NuGet.Config"), configFile);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains($"Installed {packageX} {version} from {packageSource2.FullName}", result.AllOutput);
@@ -669,7 +668,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(projectADirectory, "NuGet.Config"), configFile);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version} -s {packageSource2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version} -s {packageSource2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains($"Installed {packageX} {version} from {packageSource2}", result.AllOutput);
@@ -702,7 +701,7 @@ public void AddPkg_WhenSourceIsSignedPackageWithExpiredCertificatesAndWithTimest
CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(
projectDirectory,
$"add {projectFilePath} package {package.Id} -s {packageSourceDirectory.FullName} -v {package.Version}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
if (RuntimeEnvironmentHelper.IsWindows)
{
@@ -786,7 +785,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectADirectory = Path.Combine(pathContext.SolutionRoot, projectA.ProjectName);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(@$"
@@ -834,7 +833,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectADirectory = Path.Combine(pathContext.SolutionRoot, projectA.ProjectName);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version1}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version1}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(@$"
@@ -882,7 +881,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
//Act
//By default the package version used will be 2.0.0 since no version CLI argument is passed in the CLI command.
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", logLine: _testOutputHelper.WriteLine);
// Assert
// Checking that the PackageVersion is not updated.
@@ -932,7 +931,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectADirectory = Path.Combine(pathContext.SolutionRoot, projectA.ProjectName);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(@$"", File.ReadAllText(Path.Combine(pathContext.SolutionRoot, "Directory.Packages.props")));
@@ -984,7 +983,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectADirectory = Path.Combine(pathContext.SolutionRoot, projectA.ProjectName);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version}", logLine: _testOutputHelper.WriteLine);
// Assert
var propsFileFromDisk = File.ReadAllText(Path.Combine(pathContext.SolutionRoot, "Directory.Packages.props"));
@@ -1050,7 +1049,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains("error: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: X", result.Output);
@@ -1112,7 +1111,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains("error: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: X", result.Output);
@@ -1177,7 +1176,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var result = _fixture.RunDotnetExpectSuccess(
projectADirectory,
$"add {projectA.ProjectPath} package {packageX}",
- testOutputHelper: _testOutputHelper
+ logLine: _testOutputHelper.WriteLine
);
// Assert
@@ -1244,7 +1243,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} ", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} ", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.DoesNotContain("error: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: X", result.Output);
@@ -1309,7 +1308,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(@$"
@@ -1367,7 +1366,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.DoesNotContain("error: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: X", result.Output);
@@ -1429,7 +1428,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.DoesNotContain(@$"
@@ -1493,7 +1492,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.DoesNotContain("error: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: X", result.Output);
@@ -1558,7 +1557,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.DoesNotContain(@$"
@@ -1622,7 +1621,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(@$"
@@ -1684,7 +1683,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains("error: Package reference for package 'X' defined in incorrect location, PackageReference should be defined in project file.", result.Output);
@@ -1745,7 +1744,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(" PackageVersion for package 'X' defined in incorrect location, PackageVersion should be defined in Directory.Package.props.", result.Output);
@@ -1806,7 +1805,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "projectA", "projectA.csproj"), projectContent);
//Act
- var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectADirectory, $"add {projectA.ProjectPath} package {packageX} -v {version2}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains("The package reference X specifies a VersionOverride but the ability to override a centrally defined version is currently disabled.", result.Output);
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetIntegrationTestFixture.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetIntegrationTestFixture.cs
index 4a020132e62..e9032dc2e0b 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetIntegrationTestFixture.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetIntegrationTestFixture.cs
@@ -20,7 +20,6 @@
using NuGet.Commands;
using NuGet.Common;
using NuGet.Test.Utility;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -90,7 +89,7 @@ private void AddPackageSource(string name, string source)
/// Creates a new dotnet project of the specified type. Note that restore/build are not run when this command is invoked.
/// That is because the project generation is cached.
///
- internal void CreateDotnetNewProject(string solutionRoot, string projectName, string args, ITestOutputHelper testOutputHelper = null)
+ internal void CreateDotnetNewProject(string solutionRoot, string projectName, string args, Action logLine = null)
{
args = args.Trim();
@@ -115,7 +114,7 @@ internal void CreateDotnetNewProject(string solutionRoot, string projectName, st
}
templateDirectory.Create();
- RunDotnetExpectSuccess(templateDirectory.FullName, $"new {templateArgs}", testOutputHelper: testOutputHelper);
+ RunDotnetExpectSuccess(templateDirectory.FullName, $"new {templateArgs}", logLine: logLine);
// Delete the obj directory because it contains assets generated by running restore at dotnet new time.
// These are not relevant when the project is renamed
@@ -133,26 +132,26 @@ internal void CreateDotnetNewProject(string solutionRoot, string projectName, st
Path.Combine(workingDirectory, projectName + ".csproj"));
}
- internal CommandRunnerResult RestoreToolProjectExpectFailure(string workingDirectory, string projectName, string args = "", ITestOutputHelper testOutputHelper = null)
- => RunDotnetExpectFailure(workingDirectory, $"restore {projectName}.csproj {args}", testOutputHelper: testOutputHelper);
+ internal CommandRunnerResult RestoreToolProjectExpectFailure(string workingDirectory, string projectName, string args = "", Action logLine = null)
+ => RunDotnetExpectFailure(workingDirectory, $"restore {projectName}.csproj {args}", logLine: logLine);
- internal CommandRunnerResult RestoreToolProjectExpectSuccess(string workingDirectory, string projectName, string args = "", ITestOutputHelper testOutputHelper = null)
- => RunDotnetExpectSuccess(workingDirectory, $"restore {projectName}.csproj {args}", testOutputHelper: testOutputHelper);
+ internal CommandRunnerResult RestoreToolProjectExpectSuccess(string workingDirectory, string projectName, string args = "", Action logLine = null)
+ => RunDotnetExpectSuccess(workingDirectory, $"restore {projectName}.csproj {args}", logLine: logLine);
- internal CommandRunnerResult RestoreProjectExpectFailure(string workingDirectory, string projectName, string args = "", ITestOutputHelper testOutputHelper = null)
- => RestoreProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: false, testOutputHelper: testOutputHelper);
+ internal CommandRunnerResult RestoreProjectExpectFailure(string workingDirectory, string projectName, string args = "", Action logLine = null)
+ => RestoreProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: false, logLine: logLine);
- internal CommandRunnerResult RestoreProjectExpectSuccess(string workingDirectory, string projectName, string args = "", ITestOutputHelper testOutputHelper = null)
- => RestoreProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: true, testOutputHelper: testOutputHelper);
+ internal CommandRunnerResult RestoreProjectExpectSuccess(string workingDirectory, string projectName, string args = "", Action logLine = null)
+ => RestoreProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: true, logLine: logLine);
- internal CommandRunnerResult RestoreSolutionExpectFailure(string workingDirectory, string solutionName, string args = "", ITestOutputHelper testOutputHelper = null)
- => RestoreProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: false, testOutputHelper: testOutputHelper);
+ internal CommandRunnerResult RestoreSolutionExpectFailure(string workingDirectory, string solutionName, string args = "", Action logLine = null)
+ => RestoreProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: false, logLine: logLine);
- internal CommandRunnerResult RestoreSolutionExpectSuccess(string workingDirectory, string solutionName, string args = "", ITestOutputHelper testOutputHelper = null)
- => RestoreProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: true, testOutputHelper: testOutputHelper);
+ internal CommandRunnerResult RestoreSolutionExpectSuccess(string workingDirectory, string solutionName, string args = "", Action logLine = null)
+ => RestoreProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: true, logLine: logLine);
- private CommandRunnerResult RestoreProjectOrSolution(string workingDirectory, string fileName, string args, bool expectSuccess, ITestOutputHelper testOutputHelper = null)
- => RunDotnet(workingDirectory, $"restore {fileName} {args ?? string.Empty} -nodereuse:false", expectSuccess, testOutputHelper: testOutputHelper);
+ private CommandRunnerResult RestoreProjectOrSolution(string workingDirectory, string fileName, string args, bool expectSuccess, Action logLine = null)
+ => RunDotnet(workingDirectory, $"restore {fileName} {args ?? string.Empty} -nodereuse:false", expectSuccess, logLine: logLine);
///
/// Runs dotnet with the specified arguments and expects the command to succeed. If dotnet returns a non-zero exit code, an assertion is thrown with diagnostic information.
@@ -160,8 +159,8 @@ private CommandRunnerResult RestoreProjectOrSolution(string workingDirectory, st
/// The working directory to use when executing the command.
/// The command-line arguments to pass to dotnet.
/// An optional containing environment variables to use when executing the command.
- internal CommandRunnerResult RunDotnetExpectSuccess(string workingDirectory, string args = "", IReadOnlyDictionary environmentVariables = null, ITestOutputHelper testOutputHelper = null, Action inputAction = null)
- => RunDotnet(workingDirectory, args, expectSuccess: true, environmentVariables, testOutputHelper, inputAction);
+ internal CommandRunnerResult RunDotnetExpectSuccess(string workingDirectory, string args = "", IReadOnlyDictionary environmentVariables = null, Action logLine = null, Action inputAction = null)
+ => RunDotnet(workingDirectory, args, expectSuccess: true, environmentVariables, logLine, inputAction);
///
/// Runs dotnet with the specified arguments and expects the command to fail. If dotnet returns an exit code of zero, an assertion is thrown with diagnostic information.
@@ -169,10 +168,10 @@ internal CommandRunnerResult RunDotnetExpectSuccess(string workingDirectory, str
/// The working directory to use when executing the command.
/// The command-line arguments to pass to dotnet.
/// An optional containing environment variables to use when executing the command.
- internal CommandRunnerResult RunDotnetExpectFailure(string workingDirectory, string args = "", IReadOnlyDictionary environmentVariables = null, ITestOutputHelper testOutputHelper = null, Action inputAction = null)
- => RunDotnet(workingDirectory, args, expectSuccess: false, environmentVariables, testOutputHelper, inputAction);
+ internal CommandRunnerResult RunDotnetExpectFailure(string workingDirectory, string args = "", IReadOnlyDictionary environmentVariables = null, Action logLine = null, Action inputAction = null)
+ => RunDotnet(workingDirectory, args, expectSuccess: false, environmentVariables, logLine, inputAction);
- internal CommandRunnerResult RunDotnet(string workingDirectory, string args = "", bool expectSuccess = true, IReadOnlyDictionary environmentVariables = null, ITestOutputHelper testOutputHelper = null, Action inputAction = null)
+ internal CommandRunnerResult RunDotnet(string workingDirectory, string args = "", bool expectSuccess = true, IReadOnlyDictionary environmentVariables = null, Action logLine = null, Action inputAction = null)
{
bool enableDiagnostics = CIDebug && !string.IsNullOrWhiteSpace(BinLogDirectory);
@@ -224,7 +223,7 @@ internal CommandRunnerResult RunDotnet(string workingDirectory, string args = ""
{
Stopwatch stopwatch = Stopwatch.StartNew();
- result = CommandRunner.Run(TestDotnetCli, workingDirectory, args, inputAction: inputAction, environmentVariables: finalEnvironmentVariables, testOutputHelper: testOutputHelper);
+ result = CommandRunner.Run(TestDotnetCli, workingDirectory, args, inputAction: inputAction, environmentVariables: finalEnvironmentVariables, logLine: logLine);
stopwatch.Stop();
@@ -312,19 +311,19 @@ void CreateDiagnostics(string args, string workingDirectory, CommandRunnerResult
}
}
- internal CommandRunnerResult PackProjectExpectFailure(string workingDirectory, string projectName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", ITestOutputHelper testOutputHelper = null)
- => PackProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: false, nuspecOutputPath, configuration, testOutputHelper);
+ internal CommandRunnerResult PackProjectExpectFailure(string workingDirectory, string projectName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", Action logLine = null)
+ => PackProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: false, nuspecOutputPath, configuration, logLine);
- internal CommandRunnerResult PackProjectExpectSuccess(string workingDirectory, string projectName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", ITestOutputHelper testOutputHelper = null)
- => PackProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: true, nuspecOutputPath, configuration, testOutputHelper);
+ internal CommandRunnerResult PackProjectExpectSuccess(string workingDirectory, string projectName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", Action logLine = null)
+ => PackProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: true, nuspecOutputPath, configuration, logLine);
- internal CommandRunnerResult PackSolutionExpectFailure(string workingDirectory, string solutionName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", ITestOutputHelper testOutputHelper = null)
- => PackProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: false, nuspecOutputPath, configuration, testOutputHelper);
+ internal CommandRunnerResult PackSolutionExpectFailure(string workingDirectory, string solutionName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", Action logLine = null)
+ => PackProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: false, nuspecOutputPath, configuration, logLine);
- internal CommandRunnerResult PackSolutionExpectSuccess(string workingDirectory, string solutionName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", ITestOutputHelper testOutputHelper = null)
- => PackProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: true, nuspecOutputPath, configuration, testOutputHelper);
+ internal CommandRunnerResult PackSolutionExpectSuccess(string workingDirectory, string solutionName, string args = "", string nuspecOutputPath = "obj", string configuration = "Debug", Action logLine = null)
+ => PackProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: true, nuspecOutputPath, configuration, logLine);
- private CommandRunnerResult PackProjectOrSolution(string workingDirectory, string file, string args, bool expectSuccess, string nuspecOutputPath = "obj", string configuration = "Debug", ITestOutputHelper testOutputHelper = null)
+ private CommandRunnerResult PackProjectOrSolution(string workingDirectory, string file, string args, bool expectSuccess, string nuspecOutputPath = "obj", string configuration = "Debug", Action logLine = null)
{
if (nuspecOutputPath != null)
{
@@ -333,37 +332,37 @@ private CommandRunnerResult PackProjectOrSolution(string workingDirectory, strin
args = $"{args} /Property:Configuration={configuration}";
- return RunDotnet(workingDirectory, $"pack {file} {args}", expectSuccess, testOutputHelper: testOutputHelper);
+ return RunDotnet(workingDirectory, $"pack {file} {args}", expectSuccess, logLine: logLine);
}
- internal void BuildProjectExpectSuccess(string workingDirectory, string projectName, string args = "", bool? appendRidToOutputPath = false, ITestOutputHelper testOutputHelper = null)
+ internal void BuildProjectExpectSuccess(string workingDirectory, string projectName, string args = "", bool? appendRidToOutputPath = false, Action logLine = null)
{
if (appendRidToOutputPath != null)
{
args = $"{args} /p:AppendRuntimeIdentifierToOutputPath={appendRidToOutputPath}";
}
- BuildProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: true, testOutputHelper: testOutputHelper);
+ BuildProjectOrSolution(workingDirectory, $"{projectName}.csproj", args, expectSuccess: true, logLine: logLine);
}
- internal void BuildSolutionExpectFailure(string workingDirectory, string solutionName, string args = "", bool? appendRidToOutputPath = false, ITestOutputHelper testOutputHelper = null)
- => BuildProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: false, appendRidToOutputPath, testOutputHelper);
+ internal void BuildSolutionExpectFailure(string workingDirectory, string solutionName, string args = "", bool? appendRidToOutputPath = false, Action logLine = null)
+ => BuildProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: false, appendRidToOutputPath, logLine);
- internal void BuildSolutionExpectSuccess(string workingDirectory, string solutionName, string args = "", bool? appendRidToOutputPath = false, ITestOutputHelper testOutputHelper = null)
- => BuildProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: true, appendRidToOutputPath, testOutputHelper);
+ internal void BuildSolutionExpectSuccess(string workingDirectory, string solutionName, string args = "", bool? appendRidToOutputPath = false, Action logLine = null)
+ => BuildProjectOrSolution(workingDirectory, $"{solutionName}.slnx", args, expectSuccess: true, appendRidToOutputPath, logLine);
- private CommandRunnerResult BuildProjectOrSolution(string workingDirectory, string file, string args, bool expectSuccess = true, bool? appendRidToOutputPath = false, ITestOutputHelper testOutputHelper = null)
+ private CommandRunnerResult BuildProjectOrSolution(string workingDirectory, string file, string args, bool expectSuccess = true, bool? appendRidToOutputPath = false, Action logLine = null)
{
if (appendRidToOutputPath != null)
{
args = $"{args} /p:AppendRuntimeIdentifierToOutputPath={appendRidToOutputPath}";
}
- return RunDotnet(workingDirectory, $"msbuild {file} {args}", expectSuccess, testOutputHelper: testOutputHelper);
+ return RunDotnet(workingDirectory, $"msbuild {file} {args}", expectSuccess, logLine: logLine);
}
- internal (string Content, string ProjectPath, string FilePath) GetFileBasedAppVirtualProject(string entryPointFileFullPath, ITestOutputHelper testOutputHelper)
+ internal (string Content, string ProjectPath, string FilePath) GetFileBasedAppVirtualProject(string entryPointFileFullPath, Action logLine)
{
- var runApi = RunDotnetExpectSuccess(Path.GetDirectoryName(entryPointFileFullPath), "run-api", testOutputHelper: testOutputHelper, inputAction: writer =>
+ var runApi = RunDotnetExpectSuccess(Path.GetDirectoryName(entryPointFileFullPath), "run-api", logLine: logLine, inputAction: writer =>
{
writer.Write($$"""{ "$type": "GetProject", "EntryPointFileFullPath": {{JsonSerializer.Serialize(entryPointFileFullPath)}} }""");
});
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetListPackageTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetListPackageTests.cs
index dcbeacf91a4..4f1c716099d 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetListPackageTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetListPackageTests.cs
@@ -26,7 +26,6 @@
using NuGet.XPlat.FuncTest;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
using Strings = NuGet.CommandLine.XPlat.Strings;
namespace Dotnet.Integration.Test
@@ -65,15 +64,15 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --version 1.0.0 --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, "packageX1.0.01.0.0"));
}
@@ -100,10 +99,10 @@ public async Task DotnetListPackage_FileBasedApp()
await SimpleTestPackageUtility.CreateFolderFeedV3Async(pathContext.PackageSource, PackageSaveMode.Defaultv3, packageX);
// Restore.
- _fixture.RunDotnetExpectSuccess(fbaDir, "restore app.cs", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(fbaDir, "restore app.cs", logLine: _testOutputHelper.WriteLine);
// Get project content.
- var virtualProject = _fixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper);
+ var virtualProject = _fixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper.WriteLine);
using var builder = new TestVirtualProjectBuilder(virtualProject);
// List packages.
@@ -161,11 +160,11 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectFailure(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, "No assets file was found".Replace(" ", "")));
}
@@ -211,11 +210,11 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName),
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert Requested version is [0.1.0,), but 1.0.0 was resolved
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, "[0.1.0,)"));
@@ -265,11 +264,11 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName),
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert Resolved version is 1.0.0 and Requested version is 1.0.0, since it was overridden by VersionOverride tag
Assert.False(ContainsIgnoringSpaces(listResult.AllOutput, "2.0.0"));
@@ -320,11 +319,11 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(projectDirectory,
$"restore {projectFilePath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert Requested version is 0.1.0, but the resolved version is 1.0.0
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, "0.1.0"));
@@ -353,21 +352,21 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.False(ContainsIgnoringSpaces(listResult.AllOutput, "packageY"));
listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package --include-transitive",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, "packageY"));
@@ -408,37 +407,37 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} reference {projectB.ProjectPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectB.ProjectPath} reference {projectC.ProjectPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectB.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectB.ProjectPath).FullName,
$"add {projectB.ProjectPath} package packageY --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectB.ProjectPath).FullName,
$"add {projectC.ProjectPath} package packageZ --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj");
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package{args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.False(ContainsIgnoringSpaces(listResult.AllOutput, projectB.ProjectName));
Assert.False(ContainsIgnoringSpaces(listResult.AllOutput, projectC.ProjectName));
listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package{args} --include-transitive",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.False(ContainsIgnoringSpaces(listResult.AllOutput, projectB.ProjectName));
Assert.False(ContainsIgnoringSpaces(listResult.AllOutput, projectC.ProjectName));
@@ -475,15 +474,15 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --version {currentVersion} --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
- $"package list --project {projectA.ProjectPath} --outdated --include-transitive {args}", testOutputHelper: _testOutputHelper);
+ $"package list --project {projectA.ProjectPath} --outdated --include-transitive {args}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, $"packageX{currentVersion}{currentVersion}{expectedVersion}"));
@@ -530,12 +529,12 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"package list --project {projectA.ProjectPath} {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, shouldInclude1.Replace(" ", "")));
@@ -568,15 +567,15 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, shouldInclude.Replace(" ", "")));
@@ -606,15 +605,15 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectFailure(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package --framework net46 --framework invalidFramework",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
}
}
@@ -627,7 +626,7 @@ public void DotnetListPackage_DeprecatedAndOutdated_Fail()
var listResult = _fixture.RunDotnetExpectFailure(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package --deprecated --outdated",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.Contains(string.Format(Strings.ListPkg_InvalidOptions, "--outdated", "--deprecated"), listResult.Errors);
}
@@ -660,11 +659,11 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
//the assets file should generate 4 sections in Targets: 1 for TFM only , and 3 for TFM + RID combinations
var assetsFile = projectA.AssetsFile;
@@ -672,7 +671,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
//make sure there is no duplicate in output
Assert.True(NoDuplicateSection(listResult.AllOutput), listResult.AllOutput);
@@ -707,15 +706,15 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --version {currentVersion} --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package --outdated {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, $"packageX{currentVersion}{currentVersion}{expectedVersion}"));
@@ -738,11 +737,11 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --version 1.0.0 --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
foreach (var nupkg in Directory.EnumerateDirectories(pathContext.PackageSource))
{
@@ -752,7 +751,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package --outdated",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
string[] lines = listResult.AllOutput.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
@@ -781,10 +780,10 @@ public async Task DotnetListPackage_Outdated_WithHighestVersionUnlisted_ReportsH
// Mark the highest version as unlisted
mockServer.UnlistedPackages.Add(packageA300.Identity);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0", logLine: _testOutputHelper.WriteLine);
// Act
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --outdated", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --outdated", logLine: _testOutputHelper.WriteLine);
// Assert
// Should show 2.0.0 as the latest version, not 3.0.0 (which is unlisted)
@@ -815,20 +814,20 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --version {currentVersion} --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageY --version 1.0.0 --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package --outdated {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
string[] lines = listResult.AllOutput.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
@@ -867,15 +866,15 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"add {projectA.ProjectPath} package packageX --version 1.0.0 --no-restore",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"restore {projectA.ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName,
$"list {projectA.ProjectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, "packageX1.0.01.0.0"));
}
@@ -905,14 +904,14 @@ public void DotnetListPackage_VerbositySwitchTogglesHttpVisibility(string args,
var workingDirectory = Path.Combine(pathContext.SolutionRoot, ProjectName);
_fixture.RunDotnetExpectSuccess(workingDirectory, $"restore {ProjectName}.csproj",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(
workingDirectory,
$"list package --outdated --source {source} {args}",
environmentVariables: emptyHttpCache,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
if (showsHttp)
@@ -942,13 +941,13 @@ public async Task RunDotnetListPackage_WithHttpSourceAndAllowInsecureConnections
using var mockServer = new FileSystemBackedV3MockServer(pathContext.PackageSource);
mockServer.Start();
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", logLine: _testOutputHelper.WriteLine);
var packageSource = new PackageSource(mockServer.ServiceIndexUri, "http-source");
pathContext.Settings.AddSource(packageSource.Name, packageSource.Source, allowInsecureConnectionsValue: "true");
// Act
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --outdated", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --outdated", logLine: _testOutputHelper.WriteLine);
// Assert
var lines = result.AllOutput.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
@@ -970,13 +969,13 @@ public async Task RunDotnetListPackage_WithHttpSourceWithoutAllowInsecureConnect
using var mockServer = new FileSystemBackedV3MockServer(pathContext.PackageSource);
mockServer.Start();
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", logLine: _testOutputHelper.WriteLine);
var packageSource = new PackageSource(mockServer.ServiceIndexUri, "http-source");
pathContext.Settings.AddSource(packageSource.Name, packageSource.Source, allowInsecureConnectionsValue: "false");
// Act
- var result = _fixture.RunDotnetExpectFailure(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --outdated --no-restore", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --outdated --no-restore", logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(string.Format(CultureInfo.CurrentCulture, Strings.Error_HttpServerUsage, "list package", packageSource));
@@ -997,7 +996,7 @@ public async Task RunDotnetListPackage_WithMultipleHttpSourcesWithoutAllowInsecu
mockServer.Start();
var projectDirectory = Directory.GetParent(project.ProjectPath)!.FullName;
- _fixture.RunDotnetExpectSuccess(projectDirectory, "add package A --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(projectDirectory, "add package A --version 1.0.0", logLine: _testOutputHelper.WriteLine);
var httpSources = new[]
{
@@ -1011,7 +1010,7 @@ public async Task RunDotnetListPackage_WithMultipleHttpSourcesWithoutAllowInsecu
}
// Act
- var result = _fixture.RunDotnetExpectFailure(projectDirectory, "list package --outdated --no-restore", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(projectDirectory, "list package --outdated --no-restore", logLine: _testOutputHelper.WriteLine);
// Assert
var expectedError = string.Format(
@@ -1041,10 +1040,10 @@ public async Task DeprecatedOption_WithDirectPackageReferenceDeprecated_Succeeds
mockServer.DeprecatedPackages.Add(packageA100.Identity);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", logLine: _testOutputHelper.WriteLine);
// Act
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --deprecated", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --deprecated", logLine: _testOutputHelper.WriteLine);
// Assert
string[] lines = result.AllOutput.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
@@ -1081,10 +1080,10 @@ public async Task DeprecatedOption_WithTransitivePackageReferenceDeprecated_Succ
mockServer.DeprecatedPackages.Add(packageB100.Identity);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", logLine: _testOutputHelper.WriteLine);
// Act
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --deprecated {additionalOptions}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --deprecated {additionalOptions}", logLine: _testOutputHelper.WriteLine);
// Assert
string[] lines = result.AllOutput.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
@@ -1132,10 +1131,10 @@ public async Task DeprecatedOption_WithMultiTargetedProjectsAndDeprecatedPackage
mockServer.DeprecatedPackages.Add(packageB100.Identity);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package A --version 1.0.0", logLine: _testOutputHelper.WriteLine);
// Act
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --deprecated {additionalOptions}", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"list package --deprecated {additionalOptions}", logLine: _testOutputHelper.WriteLine);
// Assert
string[] lines = result.AllOutput.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
@@ -1199,7 +1198,7 @@ public async Task DotnetListPackage_PackageWithTargetsFileErrors_ReturnsCorrectR
{
// Arrange
using var pathContext = _fixture.CreateSimpleTestPathContext();
- _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper);
+ _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper.WriteLine);
string projectPath = Path.Combine(pathContext.SolutionRoot, ProjectName, $"{ProjectName}.csproj");
// Create a package with a .targets file that logs an error
@@ -1223,12 +1222,12 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Pre-Req
_fixture.RunDotnetExpectSuccess(Directory.GetParent(projectPath).FullName,
$"add {projectPath} package PackageX --version 1.0.0",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Act - dotnet list package should succeed despite the MSBuild error in the .targets file
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectPath).FullName,
$"list {projectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert - Verify the package is listed correctly
Assert.True(ContainsIgnoringSpaces(listResult.AllOutput, "PackageX1.0.01.0.0"));
@@ -1257,11 +1256,11 @@ public async Task DeprecatedOption_WithUnlistedPackage_Succeeds()
// Only PackageA is deprecated
mockServer.DeprecatedPackages.Add(packageA100.Identity);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0", testOutputHelper: _testOutputHelper);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0", logLine: _testOutputHelper.WriteLine);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0", logLine: _testOutputHelper.WriteLine);
// Act
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --deprecated --format json", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --deprecated --format json", logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(result.AllOutput);
@@ -1304,12 +1303,12 @@ public async Task DeprecatedOption_WithPrereleasePackage_Succeeds()
// Only PackageA is deprecated
mockServer.DeprecatedPackages.Add(packageA100.Identity);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0-alpha", testOutputHelper: _testOutputHelper);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0-alpha", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0-alpha", logLine: _testOutputHelper.WriteLine);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0-alpha", logLine: _testOutputHelper.WriteLine);
// Act
// Do not pass --prerelease argument. Since the project is already referencing the prerelease version, the command should still work.
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --deprecated --format json", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --deprecated --format json", logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(result.AllOutput);
@@ -1358,11 +1357,11 @@ public async Task VulnerableOption_WithUnlistedPackage_Succeeds()
(new Uri("https://contoso.com/advisory"), PackageVulnerabilitySeverity.Moderate, VersionRange.Parse("[1.0.0]"))
});
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0", testOutputHelper: _testOutputHelper);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0", logLine: _testOutputHelper.WriteLine);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0", logLine: _testOutputHelper.WriteLine);
// Act
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --vulnerable --format json", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --vulnerable --format json", logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(result.AllOutput);
@@ -1408,12 +1407,12 @@ public async Task VulnerableOption_WithPrereleasePackage_Succeeds()
(new Uri("https://contoso.com/advisory"), PackageVulnerabilitySeverity.Moderate, VersionRange.Parse("[1.0.0-alpha]"))
});
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0-alpha", testOutputHelper: _testOutputHelper);
- _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0-alpha", testOutputHelper: _testOutputHelper);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageA --version 1.0.0-alpha", logLine: _testOutputHelper.WriteLine);
+ _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, $"add package PackageB --version 1.0.0-alpha", logLine: _testOutputHelper.WriteLine);
// Act
// Do not pass --prerelease argument. Since the project is already referencing the prerelease version, the command should still work.
- var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --vulnerable --format json", testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(Directory.GetParent(projectA.ProjectPath).FullName, "list package --vulnerable --format json", logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(result.AllOutput);
@@ -1446,7 +1445,7 @@ public async Task DotnetListPackage_SingleTargetWithAlias_Succeeds()
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
ShouldContainIgnoringSpaces(listResult.AllOutput, "PackageX1.0.01.0.0");
@@ -1464,7 +1463,7 @@ public async Task DotnetListPackage_MultiTargetWithAliases_DifferentFrameworks_S
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
ShouldContainIgnoringSpaces(listResult.AllOutput, "PackageX1.0.01.0.0");
@@ -1484,11 +1483,11 @@ public async Task DotnetListPackage_MultiTargetWithAliases_SameFramework_Succeed
CommandRunnerResult restore = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"restore {projectPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
ShouldContainIgnoringSpaces(listResult.AllOutput, "PackageX1.0.01.0.0");
@@ -1506,7 +1505,7 @@ public async Task DotnetListPackage_SingleTargetWithAlias_FormatJson_Succeeds()
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package --format json",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(listResult.AllOutput);
@@ -1532,7 +1531,7 @@ public async Task DotnetListPackage_MultiTargetWithAliases_DifferentFrameworks_F
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package --format json",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(listResult.AllOutput);
@@ -1561,7 +1560,7 @@ public async Task DotnetListPackage_MultiTargetWithAliases_SameFramework_FormatJ
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package --format json",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(listResult.AllOutput);
@@ -1593,7 +1592,7 @@ public async Task DotnetListPackage_MultiTargetWithAliases_DifferentFrameworks_F
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package --framework {alias}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
ShouldContainIgnoringSpaces(listResult.AllOutput, "PackageX1.0.01.0.0");
@@ -1616,7 +1615,7 @@ public async Task DotnetListPackage_MultiTargetWithAliases_SameFramework_Framewo
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package --framework {alias}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
ShouldContainIgnoringSpaces(listResult.AllOutput, "PackageX1.0.01.0.0");
@@ -1642,7 +1641,7 @@ public async Task DotnetListPackage_MultiTargetWithAliases_DifferentFrameworks_F
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package --framework {alias} --format json",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(listResult.AllOutput);
@@ -1670,7 +1669,7 @@ public async Task DotnetListPackage_MultiTargetWithAliases_SameFramework_Framewo
// Act
CommandRunnerResult listResult = _fixture.RunDotnetExpectSuccess(projectDirectory,
$"list {projectPath} package --framework {alias} --format json",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
var json = JObject.Parse(listResult.AllOutput);
@@ -1696,7 +1695,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectDirectory = Path.Combine(pathContext.SolutionRoot, ProjectName);
var projectPath = Path.Combine(projectDirectory, $"{ProjectName}.csproj");
- _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper);
+ _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper.WriteLine);
var targetFrameworkVersion = $"v{TestConstants.DefaultTargetFramework.Version.Major}.{TestConstants.DefaultTargetFramework.Version.Minor}";
using (var stream = File.Open(projectPath, FileMode.Open, FileAccess.ReadWrite))
@@ -1726,7 +1725,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectDirectory = Path.Combine(pathContext.SolutionRoot, ProjectName);
var projectPath = Path.Combine(projectDirectory, $"{ProjectName}.csproj");
- _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper);
+ _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper.WriteLine);
var targetFrameworkVersion = $"v{defaultMajorFrameworkVersion}.0";
var previewTargetFrameworkVersion = $"v{defaultMajorFrameworkVersion - 1}.0";
@@ -1762,7 +1761,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectDirectory = Path.Combine(pathContext.SolutionRoot, ProjectName);
var projectPath = Path.Combine(projectDirectory, $"{ProjectName}.csproj");
- _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper);
+ _fixture.CreateDotnetNewProject(pathContext.SolutionRoot, ProjectName, args: "classlib", _testOutputHelper.WriteLine);
var targetFrameworkVersion = $"v{TestConstants.DefaultTargetFramework.Version.Major}.{TestConstants.DefaultTargetFramework.Version.Minor}";
using (var stream = File.Open(projectPath, FileMode.Open, FileAccess.ReadWrite))
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetNuGetPushTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetNuGetPushTests.cs
index 1882b438553..202a905a4a0 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetNuGetPushTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetNuGetPushTests.cs
@@ -10,7 +10,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -72,7 +71,7 @@ public async Task PushCommand_ApiKeyFromEnvironmentVariable()
// Act
var args = $"nuget push {packagePath} --source {server.Uri}push --symbol-source {server.Uri}symbols";
- var result = _fixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, args, environmentVariables, _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, args, environmentVariables, _testOutputHelper.WriteLine);
// Assert
Assert.Equal("EnvApiKey123", capturedApiKey);
@@ -125,7 +124,7 @@ public async Task PushCommand_CommandLineApiKeyTakesPrecedenceOverEnvironmentVar
// Act
var args = $"nuget push {packagePath} --source {server.Uri}push --symbol-source {server.Uri}symbols --api-key CommandLineKey --symbol-api-key CommandLineSymbolKey";
- var result = _fixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, args, environmentVariables, _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, args, environmentVariables, _testOutputHelper.WriteLine);
// Assert
Assert.Equal("CommandLineKey", capturedApiKey);
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageSearchTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageSearchTests.cs
index 766680e237d..ef5147b1281 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageSearchTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageSearchTests.cs
@@ -9,7 +9,6 @@
using NuGet.CommandLine.Xplat.Tests;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -43,7 +42,7 @@ public void DotnetPackageSearch_WithJsonOutput_Succeed()
var args = $"package search json --take 10 --prerelease --source {_packageSearchRunnerFixture.ServerWithMultipleEndpoints.Uri}v3/index.json --format json";
// Act
- var result = _testFixture.RunDotnetExpectSuccess(pathContext.PackageSource, args, testOutputHelper: _testOutputHelper);
+ var result = _testFixture.RunDotnetExpectSuccess(pathContext.PackageSource, args, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -65,7 +64,7 @@ public void DotnetPackageSearch_WithConsoleOutput_Succeed()
var args = $"package search json --take 10 --prerelease --source {_packageSearchRunnerFixture.ServerWithMultipleEndpoints.Uri}v3/index.json";
// Act
- var result = _testFixture.RunDotnetExpectSuccess(pathContext.PackageSource, args, testOutputHelper: _testOutputHelper);
+ var result = _testFixture.RunDotnetExpectSuccess(pathContext.PackageSource, args, logLine: _testOutputHelper.WriteLine);
// Assert
result.ExitCode.Should().Be(0, result.AllOutput);
@@ -103,7 +102,7 @@ public void DotnetPackageSearch_WithInvalidSource_FailWithNoHelpOutput()
string help = "dotnet package search [] [options]";
// Act
- var result = _testFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, args, testOutputHelper: _testOutputHelper);
+ var result = _testFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, args, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(error, result.AllOutput);
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageUpdateTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageUpdateTests.cs
index 7def49101f1..01e053891cb 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageUpdateTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetPackageUpdateTests.cs
@@ -22,7 +22,6 @@
using NuGet.XPlat.FuncTest;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -90,7 +89,7 @@ public async Task SingleTfmProject_PackageVersionUpdated()
var result = _testFixture.RunDotnetExpectSuccess(
workingDirectory: testContext.SolutionRoot,
args: $"package update NuGet.Internal.Test.a",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
// Assert
@@ -125,7 +124,7 @@ public async Task FileBasedApp()
""");
// Get project content.
- var virtualProject = _testFixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper);
+ var virtualProject = _testFixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper.WriteLine);
_testOutputHelper.WriteLine("before:\n" + virtualProject.Content);
Assert.Contains("""""", virtualProject.Content);
using var builder = new TestVirtualProjectBuilder(virtualProject);
@@ -206,7 +205,7 @@ public async Task SingleTfmCpmProject_PackageVersionUpdated()
var result = _testFixture.RunDotnetExpectSuccess(
workingDirectory: testContext.SolutionRoot,
args: $"package update NuGet.Internal.Test.a",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
// Assert
@@ -249,7 +248,7 @@ public async Task MultiTfmProject_PackageVersionUpdated()
var result = _testFixture.RunDotnetExpectSuccess(
workingDirectory: testContext.SolutionRoot,
args: $"package update NuGet.Internal.Test.a",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
// Assert
@@ -289,7 +288,7 @@ public async Task MultiTfmProjectWithConditionalPackageRef_PackageVersionUpdated
var result = _testFixture.RunDotnetExpectSuccess(
workingDirectory: testContext.SolutionRoot,
args: $"package update NuGet.Internal.Test.a",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
// Assert
@@ -332,7 +331,7 @@ public async Task SingleTfmProject_CommitsRestore()
var result = _testFixture.RunDotnetExpectSuccess(
workingDirectory: testContext.SolutionRoot,
args: $"package update NuGet.Internal.Test.a",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
// Assert
@@ -358,7 +357,7 @@ public void InvalidProjectFile_OutputsMeaningfulError()
var result = _testFixture.RunDotnetExpectFailure(
workingDirectory: testContext.SolutionRoot,
args: $"package update NuGet.Internal.Test.a",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
// Assert
@@ -402,7 +401,7 @@ public async Task SolutionWithTwoProjects_UpdateAll_UpdatesBothProjects(bool use
var result = _testFixture.RunDotnetExpectSuccess(
workingDirectory: testContext.SolutionRoot,
args: $"package update",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
// Assert
@@ -420,7 +419,7 @@ private string GetItemVersion(string projectPath, string itemType, string packag
var result = _testFixture.RunDotnetExpectSuccess(
workingDirectory: Path.GetDirectoryName(projectPath),
args: $"msbuild {Path.GetFileName(projectPath)} -getItem:{itemType}",
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: _envVars);
using JsonDocument document = JsonDocument.Parse(result.Output);
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRemovePackageTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRemovePackageTests.cs
index edb70291fa7..b08f8c903a5 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRemovePackageTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRemovePackageTests.cs
@@ -8,7 +8,6 @@
using NuGet.Test.Utility;
using NuGet.XPlat.FuncTest;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test;
@@ -35,7 +34,7 @@ public async Task RemovePkg_FileBasedApp()
""");
// Get project content.
- var virtualProject = _fixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper);
+ var virtualProject = _fixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper.WriteLine);
_testOutputHelper.WriteLine("before:\n" + virtualProject.Content);
Assert.Contains("""""", virtualProject.Content);
using var builder = new TestVirtualProjectBuilder(virtualProject);
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTLSCertificateValidationTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTLSCertificateValidationTests.cs
index 777067e704d..d7dd1617aa6 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTLSCertificateValidationTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTLSCertificateValidationTests.cs
@@ -8,7 +8,6 @@
using NuGet.XPlat.FuncTest;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -41,7 +40,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
pathContext.Settings.AddSource("https-feed", $"{tcpListenerServer.URI}v3/index.json", "disableTLSCertificateValidation", "true");
// Act & Assert
- _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectA.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectA.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath}", logLine: _testOutputHelper.WriteLine);
tcpListenerServer.StopServer();
}
@@ -62,7 +61,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
pathContext.Settings.AddSource("https-feed", $"{tcpListenerServer.URI}v3/index.json");
// Act & Assert
- var _result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectB.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath} -v d", testOutputHelper: _testOutputHelper);
+ var _result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectB.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath} -v d", logLine: _testOutputHelper.WriteLine);
tcpListenerServer.StopServer();
}
@@ -86,7 +85,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
pathContext.Settings.AddSource("https-feed2", $"{tcpListenerServer2.URI}v3/index.json", "disableTLSCertificateValidation", "true");
// Act & Assert
- var _result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectB.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath}", testOutputHelper: _testOutputHelper);
+ var _result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectB.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath}", logLine: _testOutputHelper.WriteLine);
tcpListenerServer1.StopServer();
tcpListenerServer2.StopServer();
}
@@ -111,7 +110,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
pathContext.Settings.AddSource("https-feed2", $"{tcpListenerServer2.URI}v3/index.json", "disableTLSCertificateValidation", "true");
// Act & Assert
- var _result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectB.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath} --source {tcpListenerServer2.URI}v3/index.json", testOutputHelper: _testOutputHelper);
+ var _result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectB.ProjectName}.csproj --configfile {pathContext.Settings.ConfigPath} --source {tcpListenerServer2.URI}v3/index.json", logLine: _testOutputHelper.WriteLine);
tcpListenerServer1.StopServer();
tcpListenerServer2.StopServer();
}
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTests.cs
index cff890ce240..e3eb1e23f70 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTests.cs
@@ -23,7 +23,6 @@
using Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
using static NuGet.Frameworks.FrameworkConstants;
namespace Dotnet.Integration.Test
@@ -50,7 +49,7 @@ public void DotnetRestore_SolutionRestoreVerifySolutionDirPassedToProjects()
{
using (SimpleTestPathContext pathContext = _dotnetFixture.CreateSimpleTestPathContext())
{
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, "proj", args: "classlib", _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, "proj", args: "classlib", _testOutputHelper.WriteLine);
var slnContents = @"
Microsoft Visual Studio Solution File, Format Version 12.00
@@ -93,7 +92,7 @@ public void DotnetRestore_SolutionRestoreVerifySolutionDirPassedToProjects()
File.Delete(projPath);
File.WriteAllText(projPath, doc.ToString());
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, "msbuild proj.sln /t:restore /p:DisableImplicitFrameworkReferences=true", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, "msbuild proj.sln /t:restore /p:DisableImplicitFrameworkReferences=true", logLine: _testOutputHelper.WriteLine);
result.ExitCode.Should().Be(1, "error text should be displayed");
result.AllOutput.Should().Contain($"|SOLUTION {PathUtility.EnsureTrailingSlash(pathContext.SolutionRoot)} proj .sln proj.sln {slnPath}|");
@@ -113,7 +112,7 @@ public void DotnetRestore_WithAuthorSignedPackage_Succeeds()
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -132,7 +131,7 @@ public void DotnetRestore_WithAuthorSignedPackage_Succeeds()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
}
}
@@ -152,7 +151,7 @@ public async Task DotnetRestore_WithUntrustedSignedPackage_LogsNU3042BasedOnOper
string workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
string projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
using (FileStream stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -180,7 +179,7 @@ public async Task DotnetRestore_WithUntrustedSignedPackage_LogsNU3042BasedOnOper
{
{ EnvironmentVariableConstants.DotNetNuGetSignatureVerification, "true" }
},
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
string expectedText = "warning NU3042:";
@@ -215,7 +214,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -252,7 +251,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(workingDirectory, "NuGet.Config"), doc.ToString());
// first restore
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var testFolder = Path.GetDirectoryName(Path.GetDirectoryName(workingDirectory));
var metadataFile = Path.Combine(testFolder, "globalPackages", packageX.Id.ToLower(), packageX.Version, ".nupkg.metadata");
@@ -261,7 +260,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var TenMinsAgo = DateTime.UtcNow.AddMinutes(-10);
File.SetLastAccessTimeUtc(metadataFile, TenMinsAgo);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var updatedAccessTime = File.GetLastAccessTimeUtc(metadataFile);
@@ -298,7 +297,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -333,7 +332,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(workingDirectory, "NuGet.Config"), doc.ToString());
// Act
- var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, "restore", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, "restore", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain($"error NU3004: Package '{packageX.Id} {packageX.Version}' from source '{pathContext.PackageSource}': signatureValidationMode is set to require, so packages are allowed only if signed by trusted signers; however, this package is unsigned.");
result.ExitCode.Should().Be(1, because: "error text should be displayed as restore failed");
@@ -369,7 +368,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (FileStream stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -404,7 +403,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(workingDirectory, "NuGet.Config"), doc.ToString());
// Act
- CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, "restore", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, "restore", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain($"error NU3004");
}
@@ -444,7 +443,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (FileStream stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -485,7 +484,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
{
{ envVarName, envVarValue }
},
- testOutputHelper: _testOutputHelper
+ logLine: _testOutputHelper.WriteLine
);
result.AllOutput.Should().Contain($"error NU3004: Package '{packageX.Id} {packageX.Version}' from source '{pathContext.PackageSource}': signatureValidationMode is set to require, so packages are allowed only if signed by trusted signers; however, this package is unsigned.");
@@ -525,7 +524,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (FileStream stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -566,7 +565,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
{
{ envVarName, envVarValue }
},
- testOutputHelper: _testOutputHelper
+ logLine: _testOutputHelper.WriteLine
);
result.AllOutput.Should().NotContain($"error NU3004");
@@ -606,7 +605,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (FileStream stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -647,7 +646,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
{
{ envVarName, envVarValue }
},
- testOutputHelper: _testOutputHelper
+ logLine: _testOutputHelper.WriteLine
);
result.AllOutput.Should().Contain($"error NU3004: Package '{packageX.Id} {packageX.Version}' from source '{pathContext.PackageSource}': signatureValidationMode is set to require, so packages are allowed only if signed by trusted signers; however, this package is unsigned.");
@@ -667,7 +666,7 @@ public void DotnetRestore_WithAuthorSignedPackageAndSignatureValidationModeAsReq
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -734,7 +733,7 @@ public void DotnetRestore_WithAuthorSignedPackageAndSignatureValidationModeAsReq
File.WriteAllText(configPath, doc.ToString());
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
}
}
@@ -753,7 +752,7 @@ public async Task DotnetRestore_OneLinePerRestore(bool useStaticGraphRestore, bo
var projectName1 = "ClassLibrary1";
var workingDirectory1 = Path.Combine(testDirectory, projectName1);
var projectFile1 = Path.Combine(workingDirectory1, $"{projectName1}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile1, FileMode.Open, FileAccess.ReadWrite))
{
@@ -809,13 +808,13 @@ public async Task DotnetRestore_OneLinePerRestore(bool useStaticGraphRestore, bo
// Act
var arguments = $"restore proj.sln {$"--source \"{pathContext.PackageSource}\""}" + (useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty);
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, arguments, environmentVariables, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, arguments, environmentVariables, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(2 == result.AllOutput.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Length, result.AllOutput);
// Act - make sure no-op does the same thing.
- result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, arguments, testOutputHelper: _testOutputHelper);
+ result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, arguments, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(2 == result.AllOutput.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Length, result.AllOutput);
@@ -835,7 +834,7 @@ public void StaticGraphRestore_CanReadSolutionFiles(bool useSlnx)
var projectName1 = "ClassLibrary1";
var workingDirectory1 = Path.Combine(testDirectory, projectName1);
var projectFile1 = Path.Combine(workingDirectory1, $"{projectName1}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", logLine: _testOutputHelper.WriteLine);
string slnContents;
string slnFileName;
@@ -881,7 +880,7 @@ public void StaticGraphRestore_CanReadSolutionFiles(bool useSlnx)
// Act
var arguments = $"restore {slnFileName} /p:RestoreUseStaticGraphEvaluation=true";
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, arguments, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, arguments, logLine: _testOutputHelper.WriteLine);
// Assert
File.Exists(Path.Combine(workingDirectory1, "obj", "project.assets.json")).Should().BeTrue();
@@ -908,7 +907,7 @@ public async Task DotnetRestore_ProjectMovedDoesNotRunRestore()
var projectFile1 = Path.Combine(projectDirectory, $"{projectName}.csproj");
var movedProjectFile = Path.Combine(movedDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile1, FileMode.Open, FileAccess.ReadWrite))
{
@@ -929,7 +928,7 @@ public async Task DotnetRestore_ProjectMovedDoesNotRunRestore()
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(projectDirectory, $"build {projectFile1} {$"--source \"{pathContext.PackageSource}\""}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(projectDirectory, $"build {projectFile1} {$"--source \"{pathContext.PackageSource}\""}", logLine: _testOutputHelper.WriteLine);
// Assert
@@ -937,7 +936,7 @@ public async Task DotnetRestore_ProjectMovedDoesNotRunRestore()
Directory.Move(projectDirectory, movedDirectory);
- result = _dotnetFixture.RunDotnetExpectSuccess(movedDirectory, $"build {movedProjectFile} --no-restore", testOutputHelper: _testOutputHelper);
+ result = _dotnetFixture.RunDotnetExpectSuccess(movedDirectory, $"build {movedProjectFile} --no-restore", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.DoesNotContain("Restored ", result.AllOutput);
@@ -950,7 +949,7 @@ public void DotnetRestore_PackageDownloadSupported_IsSet()
{
using (SimpleTestPathContext pathContext = _dotnetFixture.CreateSimpleTestPathContext())
{
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, "proj", args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, "proj", args: "classlib", logLine: _testOutputHelper.WriteLine);
var projPath = Path.Combine(pathContext.SolutionRoot, "proj", "proj.csproj");
var doc = XDocument.Parse(File.ReadAllText(projPath));
@@ -965,7 +964,7 @@ public void DotnetRestore_PackageDownloadSupported_IsSet()
File.Delete(projPath);
File.WriteAllText(projPath, doc.ToString());
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"msbuild /t:restore {projPath}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"msbuild /t:restore {projPath}", logLine: _testOutputHelper.WriteLine);
result.ExitCode.Should().Be(1, because: "error text should be displayed");
result.AllOutput.Should().Contain(errorText);
@@ -1024,7 +1023,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projdir = Path.GetDirectoryName(projectA.ProjectPath);
var projfilename = Path.GetFileNameWithoutExtension(projectA.ProjectName);
- _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectA.NuGetLockFileOutputPath));
//Now set it to locked mode
@@ -1034,7 +1033,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
//Act
//Run the restore and it should still properly restore.
//Assert within RestoreProject piece
- _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectA.NuGetLockFileOutputPath));
}
}
@@ -1054,13 +1053,13 @@ public void DotnetRestore_LockedMode_Net7WithAndWithoutPlatform()
";
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, "a.csproj"), projectFileContents);
- _dotnetFixture.RestoreProjectExpectSuccess(pathContext.SolutionRoot, "a", args: "--use-lock-file", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(pathContext.SolutionRoot, "a", args: "--use-lock-file", logLine: _testOutputHelper.WriteLine);
string lockFilePath = Path.Combine(pathContext.SolutionRoot, PackagesLockFileFormat.LockFileName);
Assert.True(File.Exists(lockFilePath));
Directory.Delete(Path.Combine(pathContext.SolutionRoot, "obj"), recursive: true);
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(pathContext.SolutionRoot, "a", args: "--locked-mode", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(pathContext.SolutionRoot, "a", args: "--locked-mode", logLine: _testOutputHelper.WriteLine);
// Assert
PackagesLockFile lockFile = PackagesLockFileFormat.Read(lockFilePath);
@@ -1156,7 +1155,7 @@ public async Task DotnetRestore_VerifyPerProjectConfigSourcesAreUsedForChildProj
solution.Create();
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectRoot.ProjectPath}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectRoot.ProjectPath}", logLine: _testOutputHelper.WriteLine);
// Assert
projects.Should().NotBeEmpty();
@@ -1249,16 +1248,16 @@ public async Task DotnetRestore_VerifyPerProjectConfigSourcesAreUsedForChildProj
}
projectRoot.Save();
var solutionPath = Path.Combine(pathContext.SolutionRoot, "solution.slnx");
- _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"new sln -n solution", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"new sln -n solution", logLine: _testOutputHelper.WriteLine);
foreach (var child in projects.Values)
{
- _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"sln {solutionPath} add {child.ProjectPath}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"sln {solutionPath} add {child.ProjectPath}", logLine: _testOutputHelper.WriteLine);
}
- _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"sln {solutionPath} add {projectRoot.ProjectPath}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"sln {solutionPath} add {projectRoot.ProjectPath}", logLine: _testOutputHelper.WriteLine);
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {solutionPath}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {solutionPath}", logLine: _testOutputHelper.WriteLine);
// Assert
projects.Count.Should().BeGreaterThan(0);
@@ -1309,7 +1308,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projdir = Path.GetDirectoryName(projectA.ProjectPath);
var projfilename = Path.GetFileNameWithoutExtension(projectA.ProjectName);
- _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectA.AssetsFileOutputPath));
var library = projectA.AssetsFile.Targets.First(e => e.RuntimeIdentifier == null).Libraries.First();
@@ -1333,7 +1332,7 @@ public async Task DotnetRestore_MultiTargettingWithAliases_Succeeds()
var projectName1 = "ClassLibrary1";
var workingDirectory1 = Path.Combine(testDirectory, projectName1);
var projectFile1 = Path.Combine(workingDirectory1, $"{projectName1}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile1, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1365,7 +1364,7 @@ public async Task DotnetRestore_MultiTargettingWithAliases_Succeeds()
}
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile1} {$"--source \"{pathContext.PackageSource}\" /p:AutomaticallyUseReferenceAssemblyPackages=false"}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile1} {$"--source \"{pathContext.PackageSource}\" /p:AutomaticallyUseReferenceAssemblyPackages=false"}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(workingDirectory1, "obj", "project.assets.json");
@@ -1392,7 +1391,7 @@ public async Task DotnetRestore_WithTargetFrameworksProperty_StaticGraphAndRegul
var projectName1 = "ClassLibrary1";
var workingDirectory1 = Path.Combine(testDirectory, projectName1);
var projectFile1 = Path.Combine(workingDirectory1, $"{projectName1}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile1, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1417,7 +1416,7 @@ public async Task DotnetRestore_WithTargetFrameworksProperty_StaticGraphAndRegul
// Preconditions
var command = $"restore {projectFile1} {$"--source \"{pathContext.PackageSource}\" /p:AutomaticallyUseReferenceAssemblyPackages=false"}";
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command, environmentVariables, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command, environmentVariables, logLine: _testOutputHelper.WriteLine);
var assetsFilePath = Path.Combine(workingDirectory1, "obj", "project.assets.json");
File.Exists(assetsFilePath).Should().BeTrue(because: "The assets file needs to exist");
@@ -1426,7 +1425,7 @@ public async Task DotnetRestore_WithTargetFrameworksProperty_StaticGraphAndRegul
target.Libraries.Should().ContainSingle(e => e.Name.Equals("x"));
// Act static graph restore
- result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command + " /p:RestoreUseStaticGraphEvaluation=true", testOutputHelper: _testOutputHelper);
+ result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command + " /p:RestoreUseStaticGraphEvaluation=true", logLine: _testOutputHelper.WriteLine);
// Ensure static graph restore no-ops
result.AllOutput.Should().Contain("All projects are up-to-date for restore.");
@@ -1450,18 +1449,18 @@ public void GenerateRestoreGraphFile_StandardAndStaticGraphRestore_AreEquivalent
{ "NUGET_USE_NEW_PACKAGESPEC_FACTORY", usePackageSpecFactory.ToString() }
};
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName2, " console", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName3, " webapp", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, "new sln --name test", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName1}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName2}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName3}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName2, " console", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName3, " webapp", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, "new sln --name test", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName1}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName2}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName3}", logLine: _testOutputHelper.WriteLine);
var targetPath = Path.Combine(testDirectory, "test.slnx");
var standardDgSpecFile = Path.Combine(pathContext.WorkingDirectory, "standard.dgspec.json");
var staticGraphDgSpecFile = Path.Combine(pathContext.WorkingDirectory, "staticGraph.dgspec.json");
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"msbuild /nologo /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{standardDgSpecFile}\" {targetPath}", environmentVariables, testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"msbuild /nologo /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{staticGraphDgSpecFile}\" /p:RestoreUseStaticGraphEvaluation=true {targetPath}", environmentVariables, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"msbuild /nologo /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{standardDgSpecFile}\" {targetPath}", environmentVariables, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"msbuild /nologo /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{staticGraphDgSpecFile}\" /p:RestoreUseStaticGraphEvaluation=true {targetPath}", environmentVariables, logLine: _testOutputHelper.WriteLine);
var regularDgSpec = File.ReadAllText(standardDgSpecFile);
var staticGraphDgSpec = File.ReadAllText(staticGraphDgSpecFile);
@@ -1503,17 +1502,17 @@ public void GenerateRestoreGraphFile_StandardAndStaticGraphRestore_AuditProperti
""";
File.WriteAllText(directoryBuildPropsPath, directoryBuildPropsContent);
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName2, " console", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName3, " webapp", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, "new sln --name test", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName1}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName2}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName3}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName2, " console", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName3, " webapp", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, "new sln --name test", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName1}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName2}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"sln add {projectName3}", logLine: _testOutputHelper.WriteLine);
var targetPath = Path.Combine(testDirectory, "test.slnx");
var standardDgSpecFile = Path.Combine(pathContext.WorkingDirectory, "standard.dgspec.json");
var staticGraphDgSpecFile = Path.Combine(pathContext.WorkingDirectory, "staticGraph.dgspec.json");
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"msbuild /nologo /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{staticGraphDgSpecFile}\" /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {targetPath}", environmentVariables, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory, $"msbuild /nologo /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{staticGraphDgSpecFile}\" /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {targetPath}", environmentVariables, logLine: _testOutputHelper.WriteLine);
DependencyGraphSpec dgSpec = DependencyGraphSpec.Load(staticGraphDgSpecFile);
for (int i = 0; i < dgSpec.Projects.Count; i++)
@@ -1550,7 +1549,7 @@ public async Task DotnetRestore_MultiTargettingProject_WithDifferentPackageRefer
var projectDirectory = Path.Combine(testDirectory, projectName);
var projectFilePath = Path.Combine(projectDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFilePath, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1575,12 +1574,12 @@ public async Task DotnetRestore_MultiTargettingProject_WithDifferentPackageRefer
// Preconditions
var additionalArgs = useStaticGraphRestore ? "/p:RestoreUseStaticGraphEvaluation=true" : string.Empty;
- var result = _dotnetFixture.RunDotnetExpectSuccess(projectDirectory, $"restore {projectFilePath} {additionalArgs}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(projectDirectory, $"restore {projectFilePath} {additionalArgs}", logLine: _testOutputHelper.WriteLine);
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
DateTime originalAssetsFileWriteTime = new FileInfo(assetsFilePath).LastWriteTimeUtc;
//Act
- result = _dotnetFixture.RunDotnetExpectSuccess(projectDirectory, $"restore {projectFilePath} --force {additionalArgs}", testOutputHelper: _testOutputHelper);
+ result = _dotnetFixture.RunDotnetExpectSuccess(projectDirectory, $"restore {projectFilePath} --force {additionalArgs}", logLine: _testOutputHelper.WriteLine);
DateTime forceAssetsFileWriteTime = new FileInfo(assetsFilePath).LastWriteTimeUtc;
forceAssetsFileWriteTime.Should().Be(originalAssetsFileWriteTime);
@@ -1605,13 +1604,13 @@ public async Task DotnetRestore_MultiTargettingProject_WithDifferentProjectRefer
await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource, CreateNetstandardCompatiblePackage("x", "1.0.0"));
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
var projectPaths = new List(originalFrameworks.Length);
foreach (var originalFramework in originalFrameworks)
{
var p2pProjectName = $"project-{originalFramework}";
- _dotnetFixture.CreateDotnetNewProject(testDirectory, p2pProjectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, p2pProjectName, "classlib", logLine: _testOutputHelper.WriteLine);
var p2pProjectFilePath = Path.Combine(testDirectory, p2pProjectName, $"{p2pProjectName}.csproj");
projectPaths.Add(p2pProjectFilePath);
@@ -1656,12 +1655,12 @@ public async Task DotnetRestore_MultiTargettingProject_WithDifferentProjectRefer
// Preconditions
var additionalArgs = useStaticGraphRestore ? "/p:RestoreUseStaticGraphEvaluation=true" : string.Empty;
- var result = _dotnetFixture.RestoreProjectExpectSuccess(projectDirectory, projectName, $"{additionalArgs} -clp:Verbosity=Minimal;Summary;ShowTimestamp", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RestoreProjectExpectSuccess(projectDirectory, projectName, $"{additionalArgs} -clp:Verbosity=Minimal;Summary;ShowTimestamp", logLine: _testOutputHelper.WriteLine);
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
DateTime originalAssetsFileWriteTime = new FileInfo(assetsFilePath).LastWriteTimeUtc;
//Act
- result = _dotnetFixture.RestoreProjectExpectSuccess(projectDirectory, projectName, $"--force {additionalArgs} -clp:Verbosity=Minimal;Summary;ShowTimestamp", testOutputHelper: _testOutputHelper);
+ result = _dotnetFixture.RestoreProjectExpectSuccess(projectDirectory, projectName, $"--force {additionalArgs} -clp:Verbosity=Minimal;Summary;ShowTimestamp", logLine: _testOutputHelper.WriteLine);
DateTime forceAssetsFileWriteTime = new FileInfo(assetsFilePath).LastWriteTimeUtc;
forceAssetsFileWriteTime.Should().Be(originalAssetsFileWriteTime);
@@ -1693,11 +1692,11 @@ public void CollectFrameworkReferences_WithTransitiveFrameworkReferences_Exclude
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var packResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"pack {libraryProjectFilePath} /p:PackageOutputPath=\"{pathContext.PackageSource}\"", testOutputHelper: _testOutputHelper);
+ var packResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"pack {libraryProjectFilePath} /p:PackageOutputPath=\"{pathContext.PackageSource}\"", logLine: _testOutputHelper.WriteLine);
// Consumer project.
var consumerName = "Consumer";
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, consumerName, "console", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, consumerName, "console", logLine: _testOutputHelper.WriteLine);
var consumerProjectFilePath = Path.Combine(Path.Combine(pathContext.SolutionRoot, consumerName), $"{consumerName}.csproj");
@@ -1723,7 +1722,7 @@ public void CollectFrameworkReferences_WithTransitiveFrameworkReferences_Exclude
");
// Act
- var buildResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"build {consumerProjectFilePath}", testOutputHelper: _testOutputHelper);
+ var buildResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"build {consumerProjectFilePath}", logLine: _testOutputHelper.WriteLine);
// Assert
buildResult.AllOutput.Should().Contain("Microsoft.NETCore.App");
@@ -1754,7 +1753,7 @@ public void Dotnet_New_Template_Restore_Success(string template)
var solutionDirectory = pathContext.SolutionRoot;
// Act
- CommandRunnerResult newResult = _dotnetFixture.RunDotnetExpectSuccess(solutionDirectory, "new " + template, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult newResult = _dotnetFixture.RunDotnetExpectSuccess(solutionDirectory, "new " + template, logLine: _testOutputHelper.WriteLine);
// Assert
// Make sure restore action was success.
@@ -1813,12 +1812,12 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projdir = Path.GetDirectoryName(projectA.ProjectPath);
var projfilename = Path.GetFileNameWithoutExtension(projectA.ProjectName);
- _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectA.AssetsFileOutputPath));
projdir = Path.GetDirectoryName(projectIntermed.ProjectPath);
projfilename = Path.GetFileNameWithoutExtension(projectIntermed.ProjectName);
- _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectIntermed.AssetsFileOutputPath));
var lockFile = reader.Read(projectIntermed.AssetsFileOutputPath);
IList libraries = lockFile.Targets[0].Libraries;
@@ -1826,7 +1825,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projdir = Path.GetDirectoryName(projectMain.ProjectPath);
projfilename = Path.GetFileNameWithoutExtension(projectMain.ProjectName);
- _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(projdir, projfilename, args, logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(projectMain.AssetsFileOutputPath));
lockFile = reader.Read(projectMain.AssetsFileOutputPath);
var errors = lockFile.LogMessages.Where(m => m.Level == LogLevel.Error);
@@ -1852,7 +1851,7 @@ public async Task DotnetRestore_WithDuplicateItem_WarnsWithLogCode(string itemNa
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var packageContext = CreateNetstandardCompatiblePackage("X", "1.0.0");
await SimpleTestPackageUtility.CreateFolderFeedV3Async(pathContext.PackageSource, packageContext);
@@ -1883,7 +1882,7 @@ public async Task DotnetRestore_WithDuplicateItem_WarnsWithLogCode(string itemNa
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain(logCode);
result.AllOutput.Contains("X [1.0.0], X [2.0.0]");
@@ -1899,7 +1898,7 @@ public async Task DotnetRestore_WithDuplicatePackageVersion_WarnsWithNU1506()
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var packageContext = CreateNetstandardCompatiblePackage("X", "1.0.0");
await SimpleTestPackageUtility.CreateFolderFeedV3Async(pathContext.PackageSource, packageContext);
@@ -1934,7 +1933,7 @@ public async Task DotnetRestore_WithDuplicatePackageVersion_WarnsWithNU1506()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("NU1506");
result.AllOutput.Contains("X [1.0.0], X [2.0.0]");
@@ -1952,7 +1951,7 @@ public async Task DotnetRestore_WithDuplicateItem_WithTreatWarningsAsErrors_Erro
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var packageContext = CreateNetstandardCompatiblePackage("X", "1.0.0");
await SimpleTestPackageUtility.CreateFolderFeedV3Async(pathContext.PackageSource, packageContext);
@@ -1986,7 +1985,7 @@ public async Task DotnetRestore_WithDuplicateItem_WithTreatWarningsAsErrors_Erro
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain(logCode);
result.AllOutput.Contains("X [1.0.0], X [2.0.0]");
@@ -2063,7 +2062,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName, "NuGet.Config"), configFile);
//Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} -v n", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} -v n", logLine: _testOutputHelper.WriteLine);
Assert.Contains($"Installed {packageX} {version} from {packageSource2.FullName}", result.AllOutput);
Assert.Contains($"Installed {packageZ} {version} from {pathContext.PackageSource}", result.AllOutput);
@@ -2139,7 +2138,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName, "NuGet.Config"), configFile);
//Act
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} -v n", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} -v n", logLine: _testOutputHelper.WriteLine);
Assert.Contains($"NU1100: Unable to resolve '{packageZ} (>= {version})'", result.AllOutput);
Assert.Contains($"NU1100: Unable to resolve '{packageK} (= {version})'", result.AllOutput);
@@ -2218,7 +2217,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName, "NuGet.Config"), configFile);
//Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --source {packageSource2.FullName};{pathContext.PackageSource} --verbosity detailed", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --source {packageSource2.FullName};{pathContext.PackageSource} --verbosity detailed", logLine: _testOutputHelper.WriteLine);
Assert.Contains($"Installed {packageX} {version} from {packageSource2.FullName}", result.AllOutput);
Assert.Contains($"Installed {packageZ} {version} from {pathContext.PackageSource}", result.AllOutput);
@@ -2291,7 +2290,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName, "NuGet.Config"), configFile);
//Act
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --source {packageSource2.FullName} --verbosity detailed", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --source {packageSource2.FullName} --verbosity detailed", logLine: _testOutputHelper.WriteLine);
Assert.Contains("Package source mapping match not found for package ID 'Y'", result.AllOutput);
Assert.Contains($"NU1100: Unable to resolve '{packageY} (>= {version})'", result.AllOutput);
@@ -2361,7 +2360,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName, "NuGet.Config"), configFile);
//Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --verbosity normal", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --verbosity normal", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains($"Installed {packageY} {version} from {pathContext.PackageSource}", result.AllOutput);
@@ -2431,7 +2430,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
File.WriteAllText(Path.Combine(pathContext.SolutionRoot, projectA.ProjectName, "NuGet.Config"), configFile);
//Act
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --verbosity detailed", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} --verbosity detailed", logLine: _testOutputHelper.WriteLine);
//Assert
Assert.Contains("Package source mapping match not found for package ID 'X'", result.AllOutput);
@@ -2449,7 +2448,7 @@ public async Task DotnetRestore_WithDuplicatePackageVersion_WithTreatWarningsAsE
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var packageContext = CreateNetstandardCompatiblePackage("X", "1.0.0");
await SimpleTestPackageUtility.CreateFolderFeedV3Async(pathContext.PackageSource, packageContext);
@@ -2487,7 +2486,7 @@ public async Task DotnetRestore_WithDuplicatePackageVersion_WithTreatWarningsAsE
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("NU1506");
result.AllOutput.Contains("X [1.0.0], X [2.0.0]");
@@ -2505,7 +2504,7 @@ public async Task DotnetRestore_WithDuplicatePackageReference_RespectsContinueOn
var package = CreateNetstandardCompatiblePackage("X", "1.0.0");
await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource, package);
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2535,7 +2534,7 @@ public async Task DotnetRestore_WithDuplicatePackageReference_RespectsContinueOn
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} /p:ContinueOnError=true", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} /p:ContinueOnError=true", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("warning NU1504");
result.AllOutput.Contains("X [1.0.0], X [2.0.0]");
@@ -2598,7 +2597,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageY);
//Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} -v n", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.WorkingDirectory, $"restore {projectA.ProjectPath} -v n", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFile = projectA.AssetsFile;
@@ -2649,7 +2648,7 @@ public async Task DotnetRestore_CentralPackageVersionManagement_NoOps()
var projectName1 = "ClassLibrary1";
var workingDirectory1 = Path.Combine(testDirectory, projectName1);
var projectFile1 = Path.Combine(workingDirectory1, $"{projectName1}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName1, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile1, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2687,7 +2686,7 @@ public async Task DotnetRestore_CentralPackageVersionManagement_NoOps()
// Preconditions
var command = $"restore {projectFile1} {$"--source \"{pathContext.PackageSource}\" /p:AutomaticallyUseReferenceAssemblyPackages=false"}";
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command, logLine: _testOutputHelper.WriteLine);
var assetsFilePath = Path.Combine(workingDirectory1, "obj", "project.assets.json");
File.Exists(assetsFilePath).Should().BeTrue(because: "The assets file needs to exist");
@@ -2696,7 +2695,7 @@ public async Task DotnetRestore_CentralPackageVersionManagement_NoOps()
target.Libraries.Should().ContainSingle(e => e.Name.Equals("x"));
// Act another restore
- result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command, testOutputHelper: _testOutputHelper);
+ result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, command, logLine: _testOutputHelper.WriteLine);
// Ensure restore no-ops
result.AllOutput.Should().Contain("All projects are up-to-date for restore.");
@@ -2726,7 +2725,7 @@ public async Task DotnetRestore_WithMultiTargetingProject_WhenTargetFrameworkIsS
// Act
var additionalArgs = useStaticGraphEvaluation ? "/p:RestoreUseStaticGraphEvaluation=true" : string.Empty;
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, args: $"restore a.csproj {additionalArgs} /p:TargetFramework=\"{tfm}\"", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, args: $"restore a.csproj {additionalArgs} /p:TargetFramework=\"{tfm}\"", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(pathContext.SolutionRoot, "obj", LockFileFormat.AssetsFileName);
@@ -2776,7 +2775,7 @@ public async Task DotnetRestore_WithMultiTargetingProject_WhenTargetFrameworkIsS
// Act
var additionalArgs = useStaticGraphEvaluation ? "/p:RestoreUseStaticGraphEvaluation=true" : string.Empty;
- var result = _dotnetFixture.RunDotnetExpectSuccess(projectAWorkingDirectory, args: $"restore a.csproj /p:TargetFramework=\"{tfm}\" /p:RestoreRecursive=\"false\" {additionalArgs}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(projectAWorkingDirectory, args: $"restore a.csproj /p:TargetFramework=\"{tfm}\" /p:RestoreRecursive=\"false\" {additionalArgs}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(projectAWorkingDirectory, "obj", LockFileFormat.AssetsFileName);
@@ -2816,7 +2815,7 @@ public async Task DotnetRestore_WithMultiTargettingProject_WhenTargetFrameworkIs
// Act
var additionalArgs = useStaticGraphEvaluation ? "/p:RestoreUseStaticGraphEvaluation=true" : string.Empty;
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, args: $"restore a.csproj /p:TargetFramework=\"{tfm}\" {additionalArgs}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, args: $"restore a.csproj /p:TargetFramework=\"{tfm}\" {additionalArgs}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(pathContext.SolutionRoot, "obj", LockFileFormat.AssetsFileName);
@@ -3015,7 +3014,7 @@ public async Task DotnetRestore_WithConditionalPrunedPackageReference_Succeeds(b
string tfm = TestConstants.DefaultTargetFramework.GetShortFolderName();
await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource, new SimpleTestPackageContext("X", "1.0.0") { Dependencies = [new SimpleTestPackageContext("Y", "1.0.0")] });
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3049,7 +3048,7 @@ public async Task DotnetRestore_WithConditionalPrunedPackageReference_Succeeds(b
{ "NUGET_USE_NEW_PACKAGESPEC_FACTORY", usePackageSpecFactory.ToString() }
};
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}" + (isStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty), environmentVariables, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}" + (isStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty), environmentVariables, logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
string assetsFilePath = Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName);
LockFile assetsFile = new LockFileFormat().Read(assetsFilePath);
@@ -3083,7 +3082,7 @@ public async Task DotnetRestore_SDKAnalysisLevelAndRestoreEnablePackagePruning_E
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource, new SimpleTestPackageContext("X", "1.0.0") { Dependencies = [new SimpleTestPackageContext("Y", "1.0.0")] });
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3113,7 +3112,7 @@ public async Task DotnetRestore_SDKAnalysisLevelAndRestoreEnablePackagePruning_E
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} {(useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty)}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} {(useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty)}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
string assetsFilePath = Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName);
LockFile assetsFile = new LockFileFormat().Read(assetsFilePath);
@@ -3137,7 +3136,7 @@ public async Task DotnetRestore_SDKAnalysisLevelAndRestoreEnablePackagePruning_D
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource, new SimpleTestPackageContext("X", "1.0.0") { Dependencies = [new SimpleTestPackageContext("Y", "1.0.0")] });
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3168,7 +3167,7 @@ public async Task DotnetRestore_SDKAnalysisLevelAndRestoreEnablePackagePruning_D
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
string assetsFilePath = Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName);
LockFile assetsFile = new LockFileFormat().Read(assetsFilePath);
@@ -3222,7 +3221,7 @@ private async Task DotnetRestore_MultiTargetedProjectWithSDKAnalysisLe
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource, new SimpleTestPackageContext("X", "1.0.0") { Dependencies = [new SimpleTestPackageContext("Y", "1.0.0")] });
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3249,7 +3248,7 @@ private async Task DotnetRestore_MultiTargetedProjectWithSDKAnalysisLe
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} {(useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty)}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} {(useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty)}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
string assetsFilePath = Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName);
LockFile assetsFile = new LockFileFormat().Read(assetsFilePath);
@@ -3304,7 +3303,7 @@ private async Task DotnetRestore_MultiTargetedProjectWithRestoreEnable
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource, new SimpleTestPackageContext("X", "1.0.0") { Dependencies = [new SimpleTestPackageContext("Y", "1.0.0")] });
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3333,7 +3332,7 @@ private async Task DotnetRestore_MultiTargetedProjectWithRestoreEnable
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} {(useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty)}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile} {(useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty)}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
string assetsFilePath = Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName);
LockFile assetsFile = new LockFileFormat().Read(assetsFilePath);
@@ -3354,7 +3353,7 @@ public void DotnetRestore_WritesExpectedAuditModeInAssetsFile(string userAuditMo
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, $"classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, $"classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3369,7 +3368,7 @@ public void DotnetRestore_WritesExpectedAuditModeInAssetsFile(string userAuditMo
}
// Act
- _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
var assetsFilePath = Path.Combine(workingDirectory, "obj", "project.assets.json");
LockFile assetsFile = new LockFileFormat().Read(assetsFilePath);
@@ -3389,7 +3388,7 @@ public void DotnetRestore_PackageReferenceWithNoVersion_OutputExpectedDiagnostic
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3407,7 +3406,7 @@ public void DotnetRestore_PackageReferenceWithNoVersion_OutputExpectedDiagnostic
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.Output.Should().Contain(expected);
}
@@ -3427,7 +3426,7 @@ public async Task DotnetRestore_WithAliasesOfTheSameFramework_UsesCorrectPackage
var projectName = "ClassLibrary1";
var projectDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(projectDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3470,7 +3469,7 @@ public async Task DotnetRestore_WithAliasesOfTheSameFramework_UsesCorrectPackage
}
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
@@ -3500,7 +3499,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
var projectName = "ClassLibrary1";
var projectDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(projectDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3539,7 +3538,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
}
// Act
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
@@ -3589,7 +3588,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
var projectName = "ClassLibrary1";
var projectDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(projectDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3628,7 +3627,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
}
// Act
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
@@ -3678,7 +3677,7 @@ public async Task DotnetRestore_WithAliasesOfSameFrameworkAndProjectReferences_T
// Create project2 with dependencies on different packages for each alias
var project2Name = "Project2";
var project2File = Path.Combine(pathContext.SolutionRoot, project2Name, $"{project2Name}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(project2File, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3727,7 +3726,7 @@ public async Task DotnetRestore_WithAliasesOfSameFrameworkAndProjectReferences_T
var project1Name = "Project1";
var project1Directory = Path.Combine(pathContext.SolutionRoot, project1Name);
var project1File = Path.Combine(project1Directory, $"{project1Name}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project1Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project1Name, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(project1File, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3761,7 +3760,7 @@ public async Task DotnetRestore_WithAliasesOfSameFrameworkAndProjectReferences_T
}
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {project1File}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {project1File}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(project1Directory, "obj", "project.assets.json");
@@ -3792,17 +3791,17 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_MultipleProjectRefere
// Create project2 - uses default framework, no custom aliases needed
string project2Name = "Project2";
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", logLine: _testOutputHelper.WriteLine);
// Create project3 - uses default framework, no custom aliases needed
var project3Name = "Project3";
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project3Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project3Name, " classlib", logLine: _testOutputHelper.WriteLine);
// Create project1 that references both project2 and project3, but with different references per alias
var project1Name = "Project1";
var project1Directory = Path.Combine(pathContext.SolutionRoot, project1Name);
var project1File = Path.Combine(project1Directory, $"{project1Name}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project1Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project1Name, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(project1File, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3845,7 +3844,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_MultipleProjectRefere
}
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {project1File}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {project1File}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(project1Directory, "obj", "project.assets.json");
@@ -3878,7 +3877,7 @@ public async Task DotnetRestore_WithAliasesOfTheSameFramework_AndSDKAnalysisLeve
var projectName = "ClassLibrary1";
var projectDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(projectDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3922,7 +3921,7 @@ public async Task DotnetRestore_WithAliasesOfTheSameFramework_AndSDKAnalysisLeve
}
// Act
- var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
@@ -3945,7 +3944,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_MultipleProjectRefere
// Create project2 with a type that Project1 will reference
string project2Name = "Project2";
var project2Directory = Path.Combine(pathContext.SolutionRoot, project2Name);
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", logLine: _testOutputHelper.WriteLine);
// Add a class to Project2
var project2ClassFile = Path.Combine(project2Directory, "Project2Type.cs");
@@ -3961,7 +3960,7 @@ public class Project2Type
// Create project3 with a type that Project1 will reference
var project3Name = "Project3";
var project3Directory = Path.Combine(pathContext.SolutionRoot, project3Name);
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project3Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project3Name, " classlib", logLine: _testOutputHelper.WriteLine);
// Add a class to Project3
var project3ClassFile = Path.Combine(project3Directory, "Project3Type.cs");
@@ -3978,7 +3977,7 @@ public class Project3Type
var project1Name = "Project1";
var project1Directory = Path.Combine(pathContext.SolutionRoot, project1Name);
var project1File = Path.Combine(project1Directory, $"{project1Name}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project1Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project1Name, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(project1File, FileMode.Open, FileAccess.ReadWrite))
{
@@ -4051,7 +4050,7 @@ public string GetFrameworkMessage()
}");
// Act - Restore
- var restoreResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {project1File}", testOutputHelper: _testOutputHelper);
+ var restoreResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {project1File}", logLine: _testOutputHelper.WriteLine);
// Assert - Verify restore results
var assetsFilePath = Path.Combine(project1Directory, "obj", "project.assets.json");
@@ -4068,7 +4067,7 @@ public string GetFrameworkMessage()
bananaTarget.Libraries.Should().Contain(e => e.Name.Equals("Project3"));
// Act - Build
- var buildResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"build {project1File} --no-restore", testOutputHelper: _testOutputHelper);
+ var buildResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"build {project1File} --no-restore", logLine: _testOutputHelper.WriteLine);
// Assert - Verify build succeeded
buildResult.ExitCode.Should().Be(0);
@@ -4092,7 +4091,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectName = "ClassLibrary1";
var projectDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(projectDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -4122,7 +4121,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
@@ -4144,7 +4143,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
var project2Name = "Project2";
var project2File = Path.Combine(pathContext.SolutionRoot, project2Name, $"{project2Name}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, project2Name, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(project2File, FileMode.Open, FileAccess.ReadWrite))
{
var xml = XDocument.Load(stream);
@@ -4173,7 +4172,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
var projectName = "ClassLibrary1";
var projectDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(projectDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -4200,7 +4199,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
}
// Act
- var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
// Assert
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
@@ -4216,7 +4215,7 @@ public async Task DotnetRestore_WithAliasesOfSameFramework_WithAssetTargetFallba
assetsFile.LogMessages[0].Code.Should().Be(NuGetLogCode.NU1701);
//assetsFile.LogMessages[0].TargetGraphs.Should().HaveCount(2);
- var buildResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"build {projectFile} --no-restore", testOutputHelper: _testOutputHelper);
+ var buildResult = _dotnetFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, $"build {projectFile} --no-restore", logLine: _testOutputHelper.WriteLine);
buildResult.AllOutput.Should().Contain("NU1702");
}
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSignTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSignTests.cs
index 1d65121568f..4f7830d5686 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSignTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSignTests.cs
@@ -13,7 +13,6 @@
using NuGet.Packaging.Signing;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
using HashAlgorithmName = NuGet.Common.HashAlgorithmName;
namespace Dotnet.Integration.Test
@@ -57,7 +56,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -84,7 +83,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
$"--certificate-fingerprint {SignatureTestUtility.GetFingerprint(storeCertificate.Certificate, HashAlgorithmName.SHA256)} " +
$"--certificate-store-name {storeCertificate.StoreName} " +
$"--certificate-store-location {storeCertificate.StoreLocation}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -108,7 +107,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectFailure(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -133,7 +132,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectFailure(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -158,7 +157,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectFailure(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -185,7 +184,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate) +
$" --timestamper {timestampService.Url.OriginalString}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().NotContain(_noTimestamperWarningCode);
@@ -209,7 +208,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectFailure(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -234,7 +233,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate),
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -264,7 +263,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate) +
$" --output {outputDir}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
string signedPackagePath = Path.Combine(outputDir, "PackageA.1.0.0.nupkg");
@@ -292,12 +291,12 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult firstResult = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.PackageSource,
args,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult secondResult = _dotnetFixture.RunDotnetExpectFailure(
pathContext.PackageSource,
args,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -323,12 +322,12 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult firstResult = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.PackageSource,
args,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
CommandRunnerResult secondResult = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.PackageSource,
args + " --overwrite",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
firstResult.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -353,7 +352,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.PackageSource,
GetDefaultArgs(packageFilePath, storeCertificate) + " --overwrite",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -385,7 +384,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
$"nuget sign {packageFilePath} " +
$"--certificate-path {pfxPath} " +
$"--certificate-password {password}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -418,7 +417,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
$"nuget sign {packageFilePath} " +
$"--certificate-path .{Path.DirectorySeparatorChar}{pfxName} " +
$"--certificate-password {password}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -447,7 +446,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectFailure(
pathContext.PackageSource,
$"nuget sign {packageFilePath} --certificate-path {pfxPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(string.Format(_invalidPasswordError, pfxPath));
@@ -472,7 +471,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
pathContext.PackageSource,
$"nuget sign {packageFilePath} " +
$"--certificate-fingerprint {SignatureTestUtility.GetFingerprint(storeCertificate.Certificate, HashAlgorithmName.SHA256)}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -507,7 +506,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
$"nuget sign {packageFilePath} " +
$"--certificate-fingerprint {SignatureTestUtility.GetFingerprint(storeCertificate.Certificate, HashAlgorithmName.SHA256)} " +
$"--timestamper {timestampService.Url}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(_timestampUnsupportedDigestAlgorithmCode);
@@ -569,7 +568,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
$"--certificate-fingerprint {certFingerprint} " +
$"--timestamper {timestampService.Url}",
expectSuccess: expectSuccess,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
return result;
}
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSourcesTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSourcesTests.cs
index 0c74ae53b6b..48ddd4f7543 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSourcesTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetSourcesTests.cs
@@ -15,7 +15,6 @@
using NuGet.Configuration;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -53,7 +52,7 @@ public void Sources_WhenAddingSource_GotAdded()
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
var loadedSettings = Settings.LoadDefaultSettings(root: workingPath, configFileName: null, machineWideSettings: null);
@@ -124,7 +123,7 @@ public void Sources_WhenAddingSourceWithCredentials_CredentialsWereAddedAndEncry
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
@@ -200,7 +199,7 @@ public void Sources_WhenAddingHttpsSource_NoError()
};
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
ISettings loadedSettings = Settings.LoadDefaultSettings(root: workingPath, configFileName: null, machineWideSettings: null);
@@ -307,7 +306,7 @@ public void Sources_WhenUpdatingHttpsSource_Succeeds()
};
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
ISettings loadedSettings = Settings.LoadDefaultSettings(root: configFileDirectory, configFileName: null, machineWideSettings: null);
@@ -369,7 +368,7 @@ public void ListSources_WhenHttpSources_ErrorsForEachHttpSource(string initialSo
null);
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Contains(initialSource, result.AllOutput);
@@ -422,7 +421,7 @@ public void Sources_WhenEnableHttpSource()
Assert.False(source.IsEnabled);
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
settings = Settings.LoadDefaultSettings(
@@ -539,7 +538,7 @@ public void Sources_NoWarnWhenDisableHttpSource()
Assert.True(source.IsEnabled);
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
settings = Settings.LoadDefaultSettings(
@@ -587,7 +586,7 @@ public void Sources_WhenAddingSourceWithCredentialsInClearText_CredentialsWereAd
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
var loadedSettings = Settings.LoadDefaultSettings(root: workingPath, configFileName: null, machineWideSettings: null);
@@ -637,7 +636,7 @@ public void Sources_WhenAddingSourceWithCredentialsToUserConfigFile_CredentialsW
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
var settings = Settings.LoadDefaultSettings(
@@ -693,7 +692,7 @@ public void Sources_WhenAddingSourceWithProtocolVersion_WasAddedWithProtocolVers
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -732,7 +731,7 @@ public void Sources_WhenAddingLocalSourceWithProtocolVersion_ProtocolVersionNotW
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -773,7 +772,7 @@ public void Sources_WhenAddingSourceWithProtocolVersion_ProtocolVersionIsValidat
// Act
var command = string.Join(" ", args);
- var result = shouldSucceed ? _fixture.RunDotnetExpectSuccess(workingPath, command, testOutputHelper: _testOutputHelper) : _fixture.RunDotnetExpectFailure(workingPath, command, testOutputHelper: _testOutputHelper);
+ var result = shouldSucceed ? _fixture.RunDotnetExpectSuccess(workingPath, command, logLine: _testOutputHelper.WriteLine) : _fixture.RunDotnetExpectFailure(workingPath, command, logLine: _testOutputHelper.WriteLine);
// Assert
if (!shouldSucceed)
@@ -831,7 +830,7 @@ public void Sources_WhenUpdatingSourceWithProtocolVersion_WasUpdatedWithProtocol
};
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(result.Success, result.Output + " " + result.Errors);
@@ -893,7 +892,7 @@ public void Sources_WhenUpdatingLocalSourceWithProtocolVersion_ProtocolVersionNo
};
// Act
- CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(result.Success, result.Output + " " + result.Errors);
@@ -957,7 +956,7 @@ public void Sources_WhenUpdatingSourceWithProtocolVersion_ProtocolVersionIsValid
// Act
var command = string.Join(" ", args);
- CommandRunnerResult result = shouldSucceed ? _fixture.RunDotnetExpectSuccess(configFileDirectory, command, testOutputHelper: _testOutputHelper) : _fixture.RunDotnetExpectFailure(configFileDirectory, command, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = shouldSucceed ? _fixture.RunDotnetExpectSuccess(configFileDirectory, command, logLine: _testOutputHelper.WriteLine) : _fixture.RunDotnetExpectFailure(configFileDirectory, command, logLine: _testOutputHelper.WriteLine);
// Assert error message
if (!shouldSucceed)
@@ -1015,7 +1014,7 @@ public void Sources_WhenEnablingADisabledSource_SourceBecameEnabled()
Assert.False(source.IsEnabled);
// Main Act
- var result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
settings = Settings.LoadDefaultSettings(
@@ -1086,7 +1085,7 @@ public void Sources_WhenDisablingAnEnabledSource_SourceBecameDisabled()
Assert.True(source.IsEnabled);
// Main Act
- var result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(configFileDirectory, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
settings = Settings.LoadDefaultSettings(
@@ -1144,7 +1143,7 @@ public void TestVerbosityQuiet_DoesNotShowInfoMessages()
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
// Ensure that no messages are shown with Verbosity as Quiet
@@ -1187,7 +1186,7 @@ public void List_Sources_LocalizatedPackagesourceKeys_ConsideredDiffererent()
};
// Act
- var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectSuccess(workingPath, string.Join(" ", args), logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(result.Output.StartsWith("Registered Sources:"));
@@ -1208,7 +1207,7 @@ internal void TestCommandInvalidArguments(string command, int badCommandIndex)
using (var testDirectory = _fixture.CreateTestDirectory())
{
// Act
- var result = _fixture.RunDotnetExpectFailure(testDirectory, command, testOutputHelper: _testOutputHelper);
+ var result = _fixture.RunDotnetExpectFailure(testDirectory, command, logLine: _testOutputHelper.WriteLine);
var commandSplit = command.Split(' ');
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetTrustTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetTrustTests.cs
index 73e2ed36f61..b70107bf627 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetTrustTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetTrustTests.cs
@@ -13,7 +13,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -59,7 +58,7 @@ Certificate fingerprint(s):
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.WorkingDirectory,
$"nuget trust --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
SettingsTestUtils.RemoveWhitespace(result.Output).Should().Contain(SettingsTestUtils.RemoveWhitespace(expectedAuthorContent));
@@ -79,7 +78,7 @@ public void DotnetTrust_Implicity_ListAction_EmptySettings_Succeeds()
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
//// Assert
result.Output.Should().Contain("There are no trusted signers.");
@@ -115,7 +114,7 @@ Certificate fingerprint(s):
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.WorkingDirectory,
$"nuget trust list --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
SettingsTestUtils.RemoveWhitespace(result.Output).Should().Contain(SettingsTestUtils.RemoveWhitespace(expectedAuthorContent));
@@ -150,7 +149,7 @@ Certificate fingerprint(s):
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust list --configfile ..{Path.DirectorySeparatorChar}{nugetConfigFileName}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
SettingsTestUtils.RemoveWhitespace(result.Output).Should().Contain(SettingsTestUtils.RemoveWhitespace(expectedAuthorContent));
@@ -194,7 +193,7 @@ public async Task DotnetTrust_AuthorAction_RelativePathConfileFile_Succeeds(bool
CommandRunnerResult resultAdd = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust author nuget {signedPackagePath} {allowUntrustedRootArg} --configfile ..{Path.DirectorySeparatorChar}{nugetConfigFileName}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultAdd.Success.Should().BeTrue();
@@ -252,7 +251,7 @@ public async Task DotnetTrust_AuthorAction_RelativePathConfileFile_WithoutExisti
CommandRunnerResult resultAdd = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust author nuget {signedPackagePath} --configfile ..{Path.DirectorySeparatorChar}{nugetConfigFileName}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultAdd.Success.Should().BeTrue();
@@ -306,7 +305,7 @@ public async Task DotnetTrust_AuthorAction_AbsolutePathConfileFile_Succeeds(bool
CommandRunnerResult resultAdd = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust author nuget {signedPackagePath} {allowUntrustedRootArg} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultAdd.Success.Should().BeTrue();
@@ -352,7 +351,7 @@ public async Task DotnetTrust_AuthorAction_TryAddSameAuthor_Fails(bool allowUntr
CommandRunnerResult resultAdd = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust author nuget {signedPackagePath} {allowUntrustedRootArg} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultAdd.Success.Should().BeTrue();
@@ -361,7 +360,7 @@ public async Task DotnetTrust_AuthorAction_TryAddSameAuthor_Fails(bool allowUntr
resultAdd = _dotnetFixture.RunDotnetExpectFailure(
pathContext.SolutionRoot,
$"nuget trust author nuget {signedPackagePath} {allowUntrustedRootArg} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Main assert
resultAdd.AllOutput.Should().Contain("error: A trusted signer 'nuget' already exists.");
@@ -409,7 +408,7 @@ public async Task DotnetTrust_RepositoryAction_Succeeds(bool allowUntrustedRoot,
CommandRunnerResult resultAdd = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust repository nuget {signedPackagePath} {allowUntrustedRootArg} {ownersArgs} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultAdd.Success.Should().BeTrue();
@@ -453,7 +452,7 @@ public async Task DotnetTrust_RepositoryAction_TryAddSameRepository_Fails()
CommandRunnerResult resultAdd = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust repository nuget {signedPackagePath} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultAdd.Success.Should().BeTrue();
@@ -462,7 +461,7 @@ public async Task DotnetTrust_RepositoryAction_TryAddSameRepository_Fails()
resultAdd = _dotnetFixture.RunDotnetExpectFailure(
pathContext.SolutionRoot,
$"nuget trust repository nuget {signedPackagePath} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Main assert
resultAdd.AllOutput.Should().Contain("error: A trusted signer 'nuget' already exists.");
@@ -500,7 +499,7 @@ public async Task DotnetTrust_CertificateFingerPrintAction_Succeeds(bool allowUn
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust certificate {authorName} {certFingerprint} {allowUntrustedRootArg} --algorithm SHA256 --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(string.Format(CultureInfo.CurrentCulture, _successfulAddTrustedSigner, "author", authorName));
@@ -548,7 +547,7 @@ public async Task DotnetTrust_CertificateFingerPrintAction_TryAddSameFingerPrint
CommandRunnerResult result = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust certificate {authorName} {certFingerprint} {allowUntrustedRootArg} --algorithm SHA256 --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(string.Format(CultureInfo.CurrentCulture, _successfulAddTrustedSigner, "author", authorName));
@@ -557,7 +556,7 @@ public async Task DotnetTrust_CertificateFingerPrintAction_TryAddSameFingerPrint
result = _dotnetFixture.RunDotnetExpectFailure(
pathContext.SolutionRoot,
$"nuget trust certificate {authorName} {certFingerprint} {allowUntrustedRootArg} --algorithm SHA256 --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Main assert
result.AllOutput.Should().Contain("The certificate finger you're trying to add is already in the certificate fingerprint list");
@@ -601,7 +600,7 @@ public async Task DotnetTrust_CertificateFingerPrintAction_WithExistingSigner_Ap
CommandRunnerResult resultAdd = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust certificate {authorName} {certFingerprint} {allowUntrustedRootArg} --algorithm SHA256 --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultAdd.Success.Should().BeTrue();
@@ -652,7 +651,7 @@ public async Task DotnetTrust_RemoveAction_Succeeds()
CommandRunnerResult resultSync = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust remove {repositoryName} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultSync.Success.Should().BeTrue();
@@ -698,7 +697,7 @@ public async Task DotnetTrust_RemoveAction_WrongName_NoChange()
CommandRunnerResult resultSync = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.SolutionRoot,
$"nuget trust remove {repositoryWrongName} --configfile {nugetConfigPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
resultSync.Success.Should().BeTrue();
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetVerifyTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetVerifyTests.cs
index 24480b6a6a4..ff4f2e75567 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetVerifyTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetVerifyTests.cs
@@ -14,7 +14,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -51,7 +50,7 @@ public async Task Verify_UnSignedPackage_Fails()
var result = _dotnetFixture.RunDotnetExpectFailure(
packageDir,
$"nuget verify {packageFile.FullName}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.Output.Should().Contain(_notSignedErrorCode);
}
@@ -71,7 +70,7 @@ public async Task Verify_AnyPackage_OutputsContentHash()
var result = _dotnetFixture.RunDotnetExpectFailure(
packageDir,
$"nuget verify {packageFile.FullName}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
string contentHash;
@@ -98,7 +97,7 @@ public void Verify_AuthorSignedAndTimestampedPackageWithOptionAll_Succeeds()
var result = _dotnetFixture.RunDotnetExpectSuccess(
testDirectory,
$"nuget verify {packageFile.FullName} --all",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.Output.Should().NotContain(_noTimestamperWarningCode);
result.Output.Should().NotContain(_primarySignatureInvalidErrorCode);
@@ -120,7 +119,7 @@ public void Verify_SignedPackageWithoutAllowedCertificate_Fails()
testDirectory,
$"nuget verify {packageFile.FullName} " +
$"--certificate-fingerprint 775AAB607AA76028A7CC7A873A9513FF0C3B40DF09B7B83D21689A3675B34D9A --certificate-fingerprint DEF",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain(_noMatchingCertErrorCode);
}
@@ -141,7 +140,7 @@ public void Verify_SignedPackageWithAllowedCertificate_Succeeds()
testDirectory,
$"nuget verify {packageFile.FullName} " +
$"--certificate-fingerprint 3F9001EA83C560D712C24CF213C3D312CB3BFF51EE89435D3430BD06B5D0EECE --certificate-fingerprint def",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
}
}
@@ -165,7 +164,7 @@ public void Verify_MultipleSignedPackagesWithWildCardAndDetailedVerbosity_MixedR
var result = _dotnetFixture.RunDotnetExpectFailure(
testDirectory1,
$"nuget verify {packagX.FullName} {Path.Combine(testDirectory2, "*.nupkg")} --verbosity normal",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("Successfully verified package 'TestPackage.AuthorSigned.1.0.0'.");
result.AllOutput.Should().Contain($"Verifying Test.Reposigned.1.0.0");
@@ -210,7 +209,7 @@ public async Task Verify_AuthorSignedPackage_WithAuthorItemTrustedCertificate_Su
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.WorkingDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// For certificate with trusted root setting allowUntrustedRoot to true/false doesn't matter
@@ -253,7 +252,7 @@ public async Task Verify_AuthorSignedPackage_WithRepositoryItemTrustedCertificat
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectFailure(
testDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.AllOutput.Should().Contain(_noMatchingCertErrorCode);
@@ -299,7 +298,7 @@ public async Task Verify_RepositorySignedPackage_WithAuthorItemUntrustedCertific
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectFailure(
testDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
verifyResult.AllOutput.Should().Contain(_noTimestamperWarningCode);
@@ -352,7 +351,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectFailure(
testDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Unless allowUntrustedRoot is set true in nuget.config verify always fails for cert without trusted root.
@@ -397,7 +396,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectSuccess(
testDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// If allowUntrustedRoot is set true in nuget.config then verify succeeds for cert with untrusted root.
@@ -447,7 +446,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectFailure(
pathContext.WorkingDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Owners is casesensitive, owner info should be "nuget;contoso" not "Nuget;Contoso"
@@ -496,7 +495,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemUntrustedCert
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.WorkingDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Owners is casesensitive, here owner "nuget" matches
@@ -550,7 +549,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemTrustedCertif
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectFailure(
testDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// Owners is casesensitive, owner info should be "nuget;contoso" not "Nuget;Contoso"
@@ -602,7 +601,7 @@ public async Task Verify_RepositorySignedPackage_WithRepositoryItemTrustedCertif
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectSuccess(
testDirectory,
$"nuget verify {signedPackagePath} {fingerprint}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// For certificate with trusted root setting allowUntrustedRoot value true/false doesn't matter.
@@ -645,7 +644,7 @@ public async Task VerifyCommand_AuthorSignedPackage_WithUntrustedCertificate_All
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectFailure(
pathContext.WorkingDirectory,
$"nuget verify {signedPackagePath} --all --certificate-fingerprint {certificateFingerprintString} --certificate-fingerprint def --configfile {nugetConfigPath2}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// allowUntrustedRoot is not set true in nuget2.config, but in nuget.config, so verify fails.
@@ -687,7 +686,7 @@ public async Task VerifyCommand_AuthorSignedPackage_WithUntrustedCertificate_All
CommandRunnerResult verifyResult = _dotnetFixture.RunDotnetExpectSuccess(
pathContext.WorkingDirectory,
$"nuget verify {signedPackagePath} --all --certificate-fingerprint {certificateFingerprintString} --certificate-fingerprint def --configfile {nugetConfigPath2}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
// allowUntrustedRoot is set true in nuget2.config, so verify succeeds.
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetWhyTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetWhyTests.cs
index c0659f4757e..cda070fe6ac 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetWhyTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetWhyTests.cs
@@ -19,7 +19,6 @@
using Spectre.Console.Testing;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -57,12 +56,12 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
packageY);
string addPackageCommandArgs = $"add {project.ProjectPath} package {packageX.Id}";
- CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, logLine: _testOutputHelper.WriteLine);
string whyCommandArgs = $"nuget why {project.ProjectPath} {packageY.Id}";
// Act
- CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(ExitCodes.Success, result.ExitCode);
@@ -93,10 +92,10 @@ public async Task WhyCommand_FileBasedApp()
""");
// Restore.
- _testFixture.RunDotnetExpectSuccess(fbaDir, "restore app.cs", testOutputHelper: _testOutputHelper);
+ _testFixture.RunDotnetExpectSuccess(fbaDir, "restore app.cs", logLine: _testOutputHelper.WriteLine);
// Get project content.
- var virtualProject = _testFixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper);
+ var virtualProject = _testFixture.GetFileBasedAppVirtualProject(appFile, _testOutputHelper.WriteLine);
using var builder = new TestVirtualProjectBuilder(virtualProject);
// Run "why" command.
@@ -146,12 +145,12 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
packageZ);
string addPackageCommandArgs = $"add {project.ProjectPath} package {packageX.Id}";
- CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, logLine: _testOutputHelper.WriteLine);
string whyCommandArgs = $"nuget why {project.ProjectPath} {packageZ.Id}";
// Act
- CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(ExitCodes.Success, result.ExitCode);
@@ -178,12 +177,12 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
packageY);
string addPackageCommandArgs = $"add {project.ProjectPath} package {packageX.Id}";
- CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, logLine: _testOutputHelper.WriteLine);
string whyCommandArgs = $"nuget why {project.ProjectPath} {packageY.Id} --framework {TestConstants.ProjectTargetFramework}";
// Act
- CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(ExitCodes.Success, result.ExitCode);
@@ -210,12 +209,12 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
packageY);
string addPackageCommandArgs = $"add {project.ProjectPath} package {packageX.Id}";
- CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, logLine: _testOutputHelper.WriteLine);
string whyCommandArgs = $"nuget why {project.ProjectPath} {packageY.Id} -f {TestConstants.ProjectTargetFramework}";
// Act
- CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(ExitCodes.Success, result.ExitCode);
@@ -231,7 +230,7 @@ public void WhyCommand_EmptyProjectArgument_Fails()
string whyCommandArgs = $"nuget why";
// Act
- CommandRunnerResult result = _testFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(ExitCodes.InvalidArguments, result.ExitCode);
@@ -248,7 +247,7 @@ public void WhyCommand_EmptyPackageArgument_Fails()
string whyCommandArgs = $"nuget why {project.ProjectPath}";
// Act
- CommandRunnerResult result = _testFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectFailure(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(ExitCodes.InvalidArguments, result.ExitCode);
@@ -275,13 +274,13 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
packageY);
string addPackageCommandArgs = $"add {project.ProjectPath} package {packageX.Id}";
- CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, logLine: _testOutputHelper.WriteLine);
var projectDirectory = Path.GetDirectoryName(project.ProjectPath);
string whyCommandArgs = $"nuget why {projectDirectory} {packageY.Id}";
// Act
- CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(ExitCodes.Success, result.ExitCode);
@@ -308,13 +307,13 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
packageY);
string addPackageCommandArgs = $"add {project.ProjectPath} package {packageX.Id}";
- CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult addPackageResult = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, addPackageCommandArgs, logLine: _testOutputHelper.WriteLine);
var assetsFile = Path.Combine(Path.GetDirectoryName(project.ProjectPath), "obj", "project.assets.json");
// Act
string whyCommandArgs = $"nuget why {assetsFile} {packageY.Id}";
- CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectSuccess(pathContext.SolutionRoot, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain(packageX.Id);
@@ -330,7 +329,7 @@ public void WhyCommand_EmptyJsonFile_OutputsError()
// Act
string whyCommandArgs = $"nuget why {jsonFilePath} packageId";
- CommandRunnerResult result = _testFixture.RunDotnetExpectFailure(testDirectory, whyCommandArgs, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _testFixture.RunDotnetExpectFailure(testDirectory, whyCommandArgs, logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().Contain("https://aka.ms/dotnet/nuget/why");
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/PackCommandTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/PackCommandTests.cs
index 4d19e6b3837..54eaa8c944f 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/PackCommandTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/PackCommandTests.cs
@@ -22,7 +22,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
@@ -48,7 +47,7 @@ public void CreatePackageWithFiles()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
File.WriteAllText(Path.Combine(workingDirectory, "abc.txt"), "hello world");
File.WriteAllText(Path.Combine(workingDirectory, "abc.props"), "");
@@ -67,8 +66,8 @@ public void CreatePackageWithFiles()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -98,8 +97,8 @@ public void PackCommand_NewProject_OutputsInDefaultPaths()
var nuspecPath = Path.Combine(workingDirectory, @"obj\Debug", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, nuspecOutputPath: null, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, nuspecOutputPath: null, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the default place");
@@ -116,16 +115,16 @@ public void PackCommand_NewProject_ContinuousOutputInBothDefaultAndCustomPaths()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// With default output path
var nupkgPath = Path.Combine(workingDirectory, @"bin\Debug", $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, @"obj\Debug", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, "--no-build", nuspecOutputPath: null, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, "--no-build", nuspecOutputPath: null, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the default place");
@@ -137,7 +136,7 @@ public void PackCommand_NewProject_ContinuousOutputInBothDefaultAndCustomPaths()
nuspecPath = Path.Combine(publishDir, $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--no-build -o {publishDir}", publishDir, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--no-build -o {publishDir}", publishDir, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -165,14 +164,14 @@ public void PackCommand_NewSolution_OutputInDefaultPaths()
var referencedProject1RelativDir = Path.Combine(projectAndReference1Folder, referencedProject1, $"{referencedProject1}.csproj");
var referencedProject2RelativDir = Path.Combine(reference2Folder, referencedProject2, $"{referencedProject2}.csproj");
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), projectName, "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), referencedProject1, "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, reference2Folder), referencedProject2, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), projectName, "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), referencedProject1, "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, reference2Folder), referencedProject2, "classlib", logLine: _testOutputHelper.WriteLine);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"new sln -n {solutionName}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {projectFileRelativ}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject1RelativDir}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject2RelativDir}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"new sln -n {solutionName}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {projectFileRelativ}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject1RelativDir}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject2RelativDir}", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(testDirectory.Path, projectFileRelativ);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -187,13 +186,13 @@ public void PackCommand_NewSolution_OutputInDefaultPaths()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreSolutionExpectSuccess(testDirectory, solutionName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreSolutionExpectSuccess(testDirectory, solutionName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(projectFolder, @"bin\Debug", $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(projectFolder, @"obj\Debug", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackSolutionExpectSuccess(testDirectory, solutionName, nuspecOutputPath: null, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackSolutionExpectSuccess(testDirectory, solutionName, nuspecOutputPath: null, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the default place");
@@ -221,14 +220,14 @@ public void PackCommand_NewSolution_ContinuousOutputInDefaultPaths()
var referencedProject1RelativDir = Path.Combine(projectAndReference1Folder, referencedProject1, $"{referencedProject1}.csproj");
var referencedProject2RelativDir = Path.Combine(reference2Folder, referencedProject2, $"{referencedProject2}.csproj");
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), projectName, "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), referencedProject1, "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, reference2Folder), referencedProject2, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), projectName, "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), referencedProject1, "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, reference2Folder), referencedProject2, "classlib", logLine: _testOutputHelper.WriteLine);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"new sln -n {solutionName}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {projectFileRelativ}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject1RelativDir}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject2RelativDir}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"new sln -n {solutionName}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {projectFileRelativ}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject1RelativDir}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject2RelativDir}", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(testDirectory.Path, projectFileRelativ);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -243,8 +242,8 @@ public void PackCommand_NewSolution_ContinuousOutputInDefaultPaths()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreSolutionExpectSuccess(testDirectory, solutionName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.BuildSolutionExpectSuccess(testDirectory, solutionName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreSolutionExpectSuccess(testDirectory, solutionName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.BuildSolutionExpectSuccess(testDirectory, solutionName, logLine: _testOutputHelper.WriteLine);
// With default output path within project folder
@@ -253,7 +252,7 @@ public void PackCommand_NewSolution_ContinuousOutputInDefaultPaths()
var nuspecPath = Path.Combine(projectFolder, @"obj\Debug", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackSolutionExpectSuccess(testDirectory, solutionName, "--no-build", nuspecOutputPath: null, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackSolutionExpectSuccess(testDirectory, solutionName, "--no-build", nuspecOutputPath: null, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the default place");
@@ -269,9 +268,9 @@ public void PackCommand_PackNewDefaultProject_NupkgExists()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -315,7 +314,7 @@ public void PackCommand_PackToolUsingAlias_DoesNotWarnAboutNoExactMatchInDepende
// Arrange
var projectName = "ConsoleApp1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " console", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " console", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -334,8 +333,8 @@ public void PackCommand_PackToolUsingAlias_DoesNotWarnAboutNoExactMatchInDepende
}
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
result.AllOutput.Should().NotContain("NU5128");
@@ -350,9 +349,9 @@ public void PackCommand_PackNewDefaultProject_IncludeSymbolsWithSnupkg()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=snupkg -o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=snupkg -o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var symbolPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.snupkg");
@@ -389,7 +388,7 @@ public void PackCommand_PackProjectWithPackageType_SnupkgContainsOnlyOnePackageT
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -399,8 +398,8 @@ public void PackCommand_PackProjectWithPackageType_SnupkgContainsOnlyOnePackageT
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=snupkg -o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=snupkg -o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var symbolPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.snupkg");
@@ -442,7 +441,7 @@ public void PackCommand_PackConsoleAppWithRID_NupkgValid(bool includeSymbols)
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " console", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " console", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -452,9 +451,9 @@ public void PackCommand_PackConsoleAppWithRID_NupkgValid(bool includeSymbols)
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var args = includeSymbols ? $"-o {workingDirectory} --include-symbols" : $"-o {workingDirectory}";
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, args, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, args, logLine: _testOutputHelper.WriteLine);
var nupkgExtension = includeSymbols ? ".symbols.nupkg" : ".nupkg";
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0{nupkgExtension}");
@@ -499,7 +498,7 @@ public void PackCommand_PackProject_PackageReferenceFloatingVersionRange()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -520,10 +519,10 @@ public void PackCommand_PackProject_PackageReferenceFloatingVersionRange()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -565,7 +564,7 @@ public async Task PackCommand_PackProject_PackageReferenceAllStableFloatingVersi
var availableVersions = "1.0.0;2.0.0";
var workingDirectory = Path.Combine(pathContext.SolutionRoot, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
foreach (string version in availableVersions.Split(';'))
{
@@ -604,10 +603,10 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -652,7 +651,7 @@ public void PackCommand_PackProject_SupportMultipleFrameworks()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -673,10 +672,10 @@ public void PackCommand_PackProject_SupportMultipleFrameworks()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -786,10 +785,10 @@ public void PackProject_DependenciesWithContentFiles_NupkgExcludesContentFilesFr
File.WriteAllText(Path.Combine(topPath, $"{topName}.csproj"), topProjectContent);
// create the base package
- _dotnetFixture.PackProjectExpectSuccess(basePackagePath, basePackageName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(basePackagePath, basePackageName, logLine: _testOutputHelper.WriteLine);
// create the top package
- _dotnetFixture.PackProjectExpectSuccess(topPath, topName, $"-o {topPath}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(topPath, topName, $"-o {topPath}", logLine: _testOutputHelper.WriteLine);
var basePkgPath = Path.Combine(pkgsPath, "BasePackage.1.0.0.nupkg");
Assert.True(File.Exists(basePkgPath));
@@ -835,7 +834,7 @@ public void PackCommand_SupportsIncludeExcludePrivateAssets_OnPackages(
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -870,10 +869,10 @@ public void PackCommand_SupportsIncludeExcludePrivateAssets_OnPackages(
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -915,8 +914,8 @@ public void PackCommand_PackProject_AddsProjectRefsAsPackageRefs()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, "console", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, "console", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -936,10 +935,10 @@ public void PackCommand_PackProject_AddsProjectRefsAsPackageRefs()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -996,8 +995,8 @@ public void PackCommand_PackProject_ExactVersionOverrideProjectRefVersionInMsbui
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var refProjectFile = Path.Combine(testDirectory, referencedProject, $"{referencedProject}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
using (var refStream = new FileStream(refProjectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -1037,10 +1036,10 @@ public void PackCommand_PackProject_ExactVersionOverrideProjectRefVersionInMsbui
ProjectFileUtils.WriteXmlToFile(refXml, refStream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -1086,8 +1085,8 @@ public void PackCommand_PackProject_GetsProjectRefVersionFromMsbuild(string tfmP
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var refProjectFile = Path.Combine(testDirectory, referencedProject, $"{referencedProject}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
using (var refStream = new FileStream(refProjectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -1114,10 +1113,10 @@ public void PackCommand_PackProject_GetsProjectRefVersionFromMsbuild(string tfmP
ProjectFileUtils.WriteXmlToFile(refXml, refStream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -1163,8 +1162,8 @@ public void PackCommand_PackProject_GetPackageVersionDependsOnWorks(string tfmPr
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var refProjectFile = Path.Combine(testDirectory, referencedProject, $"{referencedProject}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, referencedProject, "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
using (var refStream = new FileStream(refProjectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -1199,10 +1198,10 @@ public void PackCommand_PackProject_GetPackageVersionDependsOnWorks(string tfmPr
ProjectFileUtils.WriteXmlToFile(refXml, refStream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3-alpha.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.2.3-alpha.nuspec");
@@ -1253,14 +1252,14 @@ public void PackCommand_PackProject_PacksFromNuspec()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
File.WriteAllText(Path.Combine(workingDirectory, "input.nuspec"), nuspecFileContent);
File.WriteAllText(Path.Combine(workingDirectory, "abc.txt"), "sample text");
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"-o {workingDirectory} /p:NuspecFile=input.nuspec",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"PackedFromNuspec.1.2.1.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -1294,7 +1293,7 @@ public void PackCommand_PackProject_EmptyNuspecFilePropertyWithNuspecProperties(
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1304,11 +1303,11 @@ public void PackCommand_PackProject_EmptyNuspecFilePropertyWithNuspecProperties(
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"-o {workingDirectory} /p:NuspecFile=",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"ClassLibrary1.1.0.0.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -1341,8 +1340,8 @@ public void PackCommand_PackProject_PackNuspecWithoutBuild()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, "/restore", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, "/restore", logLine: _testOutputHelper.WriteLine);
File.WriteAllText(Path.Combine(workingDirectory, "abc.nuspec"), nuspecFileContent);
File.WriteAllText(Path.Combine(workingDirectory, "abc.txt"), "sample text");
@@ -1355,7 +1354,7 @@ public void PackCommand_PackProject_PackNuspecWithoutBuild()
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"-o {workingDirectory} --no-build",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"PackedFromNuspec.1.2.1.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -1388,9 +1387,9 @@ public void PackCommand_PackNewDefaultProject_InstallPackageToOutputPath()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory} /p:OutputFileNamesWithoutVersion=true /p:InstallPackageToOutputPath=true", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory} /p:OutputFileNamesWithoutVersion=true /p:InstallPackageToOutputPath=true", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.nupkg");
var nupkgSha512Path = Path.Combine(workingDirectory, $"{projectName}.nupkg.sha512");
@@ -1445,15 +1444,15 @@ public void PackCommand_PackProject_PacksFromNuspec_InstallPackageToOutputPath()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
File.WriteAllText(Path.Combine(workingDirectory, "input.nuspec"), nuspecFileContent);
_dotnetFixture.PackProjectExpectSuccess(
workingDirectory,
projectName,
$"-o {workingDirectory} /p:NuspecFile=input.nuspec /p:OutputFileNamesWithoutVersion=true /p:InstallPackageToOutputPath=true",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nuspecFilePath = Path.Combine(workingDirectory, "PackedFromNuspec.nuspec");
var nupackageFilePath = Path.Combine(workingDirectory, "PackedFromNuspec.nupkg");
@@ -1517,14 +1516,14 @@ string expectedTags
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
File.WriteAllText(Path.Combine(workingDirectory, "input.nuspec"), nuspecFileContent);
File.WriteAllText(Path.Combine(workingDirectory, "abc.txt"), "sample text");
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"-o {workingDirectory} /p:NuspecFile=input.nuspec " + nuspecProperties,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{expectedId}.{expectedVersion}.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -1572,14 +1571,14 @@ public void PackCommand_PackProject_PacksFromNuspecWithBasePath()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
File.WriteAllText(Path.Combine(workingDirectory, "input.nuspec"), nuspecFileContent);
File.WriteAllText(Path.Combine(basePathDirectory, "abc.txt"), "sample text");
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"-o {workingDirectory} /p:NuspecFile=input.nuspec /p:NuspecBasePath={basePathDirectory.Path}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"PackedFromNuspec.1.2.1.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -1671,7 +1670,7 @@ public void PackCommand_PackProject_PackagePathPacksContentCorrectly(string sour
Directory.CreateDirectory(Path.Combine(workingDirectory, "folderA", "folderB"));
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1708,10 +1707,10 @@ public void PackCommand_PackProject_PackagePathPacksContentCorrectly(string sour
File.WriteAllText(pathToContent, "this is sample text in the content file");
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -1750,7 +1749,7 @@ public void PackCommand_PackProject_OutputsCorrectVersion(string versionPrefix,
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1760,14 +1759,14 @@ public void PackCommand_PackProject_OutputsCorrectVersion(string versionPrefix,
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var args = "" +
(versionPrefix != null ? $" /p:VersionPrefix={versionPrefix} " : string.Empty) +
(versionSuffix != null ? $" /p:VersionSuffix={versionSuffix} " : string.Empty) +
(packageVersion != null ? $" /p:PackageVersion={packageVersion} " : string.Empty);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory} {args}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory} {args}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.{expectedVersion}.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.{expectedVersion}.nuspec");
@@ -1861,7 +1860,7 @@ public void PackCommand_PackProject_OutputsContentFilesInNuspecForSingleFramewor
}
File.WriteAllText(pathToContent, "this is sample text in the content file");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1886,10 +1885,10 @@ public void PackCommand_PackProject_OutputsContentFilesInNuspecForSingleFramewor
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -1957,7 +1956,7 @@ public void PackCommand_PackProject_OutputsContentFilesInNuspecForMultipleFramew
}
File.WriteAllText(pathToContent, "this is sample text in the content file");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -1978,10 +1977,10 @@ public void PackCommand_PackProject_OutputsContentFilesInNuspecForMultipleFramew
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -2095,7 +2094,7 @@ public void PackCommand_SingleFramework_GeneratesPackageOnBuild()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2107,8 +2106,8 @@ public void PackCommand_SingleFramework_GeneratesPackageOnBuild()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", "Debug", $"{projectName}.1.0.0.nuspec");
@@ -2164,7 +2163,7 @@ public void PackCommand_MultipleFrameworks_GeneratesPackageOnBuild(string framew
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2175,8 +2174,8 @@ public void PackCommand_MultipleFrameworks_GeneratesPackageOnBuild(string framew
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", "Debug", $"{projectName}.1.0.0.nuspec");
@@ -2224,8 +2223,8 @@ public void PackCommand_PackNewDefaultProject_IncludeBuildOutputDoesNotCreateLib
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(Path.Combine(workingDirectory, $"{projectName}.csproj"), FileMode.Open, FileAccess.ReadWrite))
{
@@ -2247,7 +2246,7 @@ public void PackCommand_PackNewDefaultProject_IncludeBuildOutputDoesNotCreateLib
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"-o {workingDirectory} /p:IncludeBuildOutput=false",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -2291,11 +2290,11 @@ public void PackCommand_PackNewDefaultProject_BuildOutputTargetFolderOutputsLibs
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"-o {workingDirectory} /p:BuildOutputTargetFolder={buildOutputTargetFolder}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -2327,7 +2326,7 @@ public void PackCommand_PackNewProject_CleanDeletesNupkgAndNuspec()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2338,8 +2337,8 @@ public void PackCommand_PackNewProject_CleanDeletesNupkgAndNuspec()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -2349,7 +2348,7 @@ public void PackCommand_PackNewProject_CleanDeletesNupkgAndNuspec()
// Run the clean target
_dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName,
$"/t:Clean /p:PackageOutputPath={workingDirectory}\\",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(!File.Exists(nupkgPath), "The output .nupkg was not deleted by the Clean target");
Assert.True(!File.Exists(nuspecPath), "The intermediate nuspec file was not deleted by the Clean target");
@@ -2367,7 +2366,7 @@ public void PackCommand_PackNewProject_CleanDeletesOnlyGeneratedNupkgAndNuspec()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2378,8 +2377,8 @@ public void PackCommand_PackNewProject_CleanDeletesOnlyGeneratedNupkgAndNuspec()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} ", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} ", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -2393,7 +2392,7 @@ public void PackCommand_PackNewProject_CleanDeletesOnlyGeneratedNupkgAndNuspec()
// Run the clean target
_dotnetFixture.BuildProjectExpectSuccess(workingDirectory, projectName,
$"/t:Clean /p:PackageOutputPath={workingDirectory}\\",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
Assert.True(!File.Exists(nupkgPath), "The output .nupkg was not deleted by the Clean target");
Assert.True(!File.Exists(nuspecPath), "The intermediate nuspec file was not deleted by the Clean target");
@@ -2468,7 +2467,7 @@ public void PackCommand_PackProject_ContentTargetFoldersPacksContentCorrectly(st
Directory.CreateDirectory(Path.Combine(workingDirectory, "folderA", "folderB"));
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2501,10 +2500,10 @@ public void PackCommand_PackProject_ContentTargetFoldersPacksContentCorrectly(st
}
File.WriteAllText(pathToContent, "this is sample text in the content file");
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -2533,7 +2532,7 @@ public void PackCommand_NewProject_AddsTitleToNuspec()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2544,8 +2543,8 @@ public void PackCommand_NewProject_AddsTitleToNuspec()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -2614,7 +2613,7 @@ public class ExtensionMethods
File.WriteAllText(Path.Combine(workingDirectory, "Extensions", "ExtensionMethods.cs"),
extensionSrcFileContent);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2624,10 +2623,10 @@ public class ExtensionMethods
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
_dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName,
$"--include-source /p:PackageOutputPath={workingDirectory}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var symbolsNupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.symbols.nupkg");
@@ -2667,7 +2666,7 @@ public void PackCommand_ContentInnerTargetExtension_AddsTfmSpecificContent(strin
File.WriteAllText(Path.Combine(workingDirectory, "Extensions", "ext.txt"), "hello world again");
File.WriteAllText(Path.Combine(workingDirectory, "Extensions", "cs", "ext.cs.txt"), "hello world again");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2691,8 +2690,8 @@ public void PackCommand_ContentInnerTargetExtension_AddsTfmSpecificContent(strin
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -2738,7 +2737,7 @@ public void PackCommand_ContentInnerTargetExtension_AddsExtraSymbolFiles(string
Directory.CreateDirectory(workingDirectory);
File.WriteAllText(Path.Combine(workingDirectory, "abc.pdb"), "hello world");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2758,7 +2757,7 @@ public void PackCommand_ContentInnerTargetExtension_AddsExtraSymbolFiles(string
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.symbols.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -2786,7 +2785,7 @@ public void PackCommand_ContentInnerTargetExtension_SymbolFilesWithoutDll()
Directory.CreateDirectory(workingDirectory);
File.WriteAllText(Path.Combine(workingDirectory, "abc.pdb"), "hello world");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2807,7 +2806,7 @@ public void PackCommand_ContentInnerTargetExtension_SymbolFilesWithoutDll()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.symbols.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -2835,7 +2834,7 @@ public void PackCommand_ContentInnerTargetExtension_Snupkg()
Directory.CreateDirectory(workingDirectory);
File.WriteAllText(Path.Combine(workingDirectory, "abc.pdb"), "hello world");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2856,7 +2855,7 @@ public void PackCommand_ContentInnerTargetExtension_Snupkg()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.snupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -2882,7 +2881,7 @@ public void PackCommand_ContentInnerTargetExtension_SymbolFilesWithoutBuildOuput
Directory.CreateDirectory(workingDirectory);
File.WriteAllText(Path.Combine(workingDirectory, "abc.pdb"), "hello world");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2904,7 +2903,7 @@ public void PackCommand_ContentInnerTargetExtension_SymbolFilesWithoutBuildOuput
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.snupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -2930,7 +2929,7 @@ public void PackCommand_ContentInnerTargetExtension_SymbolFilesDllWithRecursive(
Directory.CreateDirectory(symbolPath);
File.WriteAllText(Path.Combine(symbolPath, "abc.pdb"), "hello world");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -2951,7 +2950,7 @@ public void PackCommand_ContentInnerTargetExtension_SymbolFilesDllWithRecursive(
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.symbols.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -2984,7 +2983,7 @@ public void PackCommand_BuildOutputInnerTargetExtension_AddsTfmSpecificBuildOupu
File.WriteAllText(Path.Combine(workingDirectory, "abc.pdb"), "hello world");
var pathToDll = Path.Combine(workingDirectory, "abc.dll");
var pathToPdb = Path.Combine(workingDirectory, "abc.pdb");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3006,8 +3005,8 @@ public void PackCommand_BuildOutputInnerTargetExtension_AddsTfmSpecificBuildOupu
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:IncludeSymbols=true /p:SymbolPackageFormat=symbols.nupkg", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:IncludeSymbols=true /p:SymbolPackageFormat=symbols.nupkg", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3074,7 +3073,7 @@ public void PackCommand_PackProject_GlobbingPathsPacksContentCorrectly(string so
Directory.CreateDirectory(Path.Combine(workingDirectory, "folderA", "folderB"));
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3101,12 +3100,12 @@ public void PackCommand_PackProject_GlobbingPathsPacksContentCorrectly(string so
File.WriteAllText(Path.Combine(workingDirectory, "folderA", "folderA.txt"), "hello world from subfolder A directory");
File.WriteAllText(Path.Combine(workingDirectory, "folderA", "folderB", "folderB.txt"), "hello world from subfolder B directory");
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -3144,7 +3143,7 @@ public void PackCommand_PackProject_AddsReferenceAsFrameworkAssemblyReference(st
// Create the subdirectory structure for testing possible source paths for the content file
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3174,11 +3173,11 @@ public void PackCommand_PackProject_AddsReferenceAsFrameworkAssemblyReference(st
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -3224,7 +3223,7 @@ public void PackCommand_PackProject_OutputsBuildActionForContentFiles(string ite
// Create the subdirectory structure for testing possible source paths for the content file
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
File.WriteAllBytes(Path.Combine(workingDirectory, "abc.png"), Array.Empty());
@@ -3248,11 +3247,11 @@ public void PackCommand_PackProject_OutputsBuildActionForContentFiles(string ite
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -3290,14 +3289,14 @@ public void PackCommand_PackSolution_AddsProjectRefsAsPackageRefs()
var referencedProject1RelativDir = Path.Combine(projectAndReference1Folder, referencedProject1, $"{referencedProject1}.csproj");
var referencedProject2RelativDir = Path.Combine(rederence2Folder, referencedProject2, $"{referencedProject2}.csproj");
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), projectName, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), referencedProject1, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
- _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, rederence2Folder), referencedProject2, "classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), projectName, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, projectAndReference1Folder), referencedProject1, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.CreateDotnetNewProject(Path.Combine(testDirectory.Path, rederence2Folder), referencedProject2, "classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"new sln -n {solutionName}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {projectFileRelativ}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject1RelativDir}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject2RelativDir}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"new sln -n {solutionName}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {projectFileRelativ}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject1RelativDir}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.RunDotnetExpectSuccess(testDirectory.Path, $"sln {solutionName}.slnx add {referencedProject2RelativDir}", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(testDirectory.Path, projectFileRelativ);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -3326,9 +3325,9 @@ public void PackCommand_PackSolution_AddsProjectRefsAsPackageRefs()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreSolutionExpectSuccess(testDirectory, solutionName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreSolutionExpectSuccess(testDirectory, solutionName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackSolutionExpectSuccess(testDirectory, solutionName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackSolutionExpectSuccess(testDirectory, solutionName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(projectFolder, "bin", "Debug", $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(projectFolder, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3391,7 +3390,7 @@ public void PackCommand_PackTargetHook_ExecutesBeforePack(string tfmProperty,
var workingDirectory = Path.Combine(testDirectory, projectName);
Directory.CreateDirectory(workingDirectory);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3406,8 +3405,8 @@ public void PackCommand_PackTargetHook_ExecutesBeforePack(string tfmProperty,
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var indexOfHelloWorld = result.AllOutput.IndexOf("Hello World");
var indexOfPackSuccessful = result.AllOutput.IndexOf("Successfully created package");
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -3433,7 +3432,7 @@ public void PackCommand_PackTarget_IsIncremental(string tfmProperty, string tfmV
var workingDirectory = Path.Combine(testDirectory, projectName);
Directory.CreateDirectory(workingDirectory);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3443,12 +3442,12 @@ public void PackCommand_PackTarget_IsIncremental(string tfmProperty, string tfmV
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} -bl:firstPack.binlog", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} -bl:firstPack.binlog", logLine: _testOutputHelper.WriteLine);
var nupkgLastWriteTime = File.GetLastWriteTimeUtc(nupkgPath);
var nuspecLastWriteTime = File.GetLastWriteTimeUtc(nuspecPath);
@@ -3456,7 +3455,7 @@ public void PackCommand_PackTarget_IsIncremental(string tfmProperty, string tfmV
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
Assert.True(File.Exists(nuspecPath), "The intermediate nuspec file is not in the expected place");
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} -bl:secondPack.binlog", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} -bl:secondPack.binlog", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
Assert.True(File.Exists(nuspecPath), "The intermediate nuspec file is not in the expected place");
@@ -3477,7 +3476,7 @@ public void PackCommand_NoWarn_SuppressesWarnings(string property, string value,
var workingDirectory = Path.Combine(testDirectory, projectName);
Directory.CreateDirectory(workingDirectory);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3488,12 +3487,12 @@ public void PackCommand_NoWarn_SuppressesWarnings(string property, string value,
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
Assert.True(File.Exists(nuspecPath), "The intermediate nuspec file is not in the expected place");
@@ -3523,7 +3522,7 @@ public void PackCommand_WarnAsError_PrintsWarningsAsErrors(string property, stri
var workingDirectory = Path.Combine(testDirectory, projectName);
Directory.CreateDirectory(workingDirectory);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3534,14 +3533,14 @@ public void PackCommand_WarnAsError_PrintsWarningsAsErrors(string property, stri
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0-rtm.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0-rtm.nuspec");
var result = expectToError
- ? _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", testOutputHelper: _testOutputHelper)
- : _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", testOutputHelper: _testOutputHelper);
+ ? _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", logLine: _testOutputHelper.WriteLine)
+ : _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(nuspecPath), "The intermediate nuspec file is not in the expected place");
if (expectToError)
@@ -3567,7 +3566,7 @@ public void PackCommand_IncrementalPack_FailsWhenInvokedTwiceInARow()
var workingDirectory = Path.Combine(testDirectory, projectName);
Directory.CreateDirectory(workingDirectory);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3578,19 +3577,19 @@ public void PackCommand_IncrementalPack_FailsWhenInvokedTwiceInARow()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0-rtm.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0-rtm.nuspec");
// Call once.
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(nuspecPath), "The intermediate nuspec file is not in the expected place");
Assert.False(File.Exists(nupkgPath), "The output .nupkg should not exist when pack fails.");
result.AllOutput.Should().Contain(NuGetLogCode.NU5102.ToString());
// Call twice.
- result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", testOutputHelper: _testOutputHelper);
+ result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory} /p:Version={semver2Version}", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(nuspecPath), "The intermediate nuspec file is not in the expected place");
Assert.False(File.Exists(nupkgPath), "The output .nupkg should not exist when pack fails.");
result.AllOutput.Should().Contain(NuGetLogCode.NU5102.ToString());
@@ -3607,7 +3606,7 @@ public void PackCommand_PackWithRepositoryVerifyNuspec()
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3619,8 +3618,8 @@ public void PackCommand_PackWithRepositoryVerifyNuspec()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3650,7 +3649,7 @@ public void PackCommand_PackWithSourceControlInformation_Unsupported_VerifyNuspe
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
File.WriteAllText(
Path.Combine(workingDirectory, "Directory.Build.targets"),
@@ -3670,8 +3669,8 @@ public void PackCommand_PackWithSourceControlInformation_Unsupported_VerifyNuspe
");
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3704,7 +3703,7 @@ public void PackCommand_PackWithSourceControlInformation_PrivateUrl_VerifyNuspec
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3738,8 +3737,8 @@ public void PackCommand_PackWithSourceControlInformation_PrivateUrl_VerifyNuspec
File.WriteAllText(Path.Combine(workingDirectory, "Directory.build.targets"), mockXml);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3770,7 +3769,7 @@ public void PackCommand_PackWithSourceControlInformation_PublishedUrl_VerifyNusp
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3800,8 +3799,8 @@ public void PackCommand_PackWithSourceControlInformation_PublishedUrl_VerifyNusp
File.WriteAllText(Path.Combine(workingDirectory, "Directory.build.targets"), mockXml);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3832,7 +3831,7 @@ public void PackCommand_PackWithSourceControlInformation_ProjectOverride_VerifyN
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3861,8 +3860,8 @@ public void PackCommand_PackWithSourceControlInformation_ProjectOverride_VerifyN
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3896,7 +3895,7 @@ public void PackCommand_ManualAddPackage_DevelopmentDependency()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3917,10 +3916,10 @@ public void PackCommand_ManualAddPackage_DevelopmentDependency()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -3959,7 +3958,7 @@ public void PackCommand_SuppressDependencies_DoesNotContainAnyDependency(string
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -3988,10 +3987,10 @@ public void PackCommand_SuppressDependencies_DoesNotContainAnyDependency(string
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4031,7 +4030,7 @@ public void PackCommand_BuildOutput_DoesNotContainForSpecificFramework(string fr
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -4041,10 +4040,10 @@ public void PackCommand_BuildOutput_DoesNotContainForSpecificFramework(string fr
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4071,7 +4070,7 @@ public void PackCommand_BuildOutput_DoesNotContainDefaultExtensions()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -4082,10 +4081,10 @@ public void PackCommand_BuildOutput_DoesNotContainDefaultExtensions()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4116,7 +4115,7 @@ public void PackCommand_PackLicense_SimpleExpression_StandardLicense(string lice
// Set up
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4127,8 +4126,8 @@ public void PackCommand_PackLicense_SimpleExpression_StandardLicense(string lice
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4167,7 +4166,7 @@ public void PackCommand_PackLicense_ComplexExpression_WithNonStandardLicense()
// Set up
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4178,8 +4177,8 @@ public void PackCommand_PackLicense_ComplexExpression_WithNonStandardLicense()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4220,7 +4219,7 @@ public void PackCommand_PackLicense_NonParsableExpressionFailsErrorWithCode(stri
// Set up
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4231,8 +4230,8 @@ public void PackCommand_PackLicense_NonParsableExpressionFailsErrorWithCode(stri
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4253,7 +4252,7 @@ public void PackCommand_PackLicense_NonParsableVersionFailsErrorWithCode()
// Set up
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4265,8 +4264,8 @@ public void PackCommand_PackLicense_NonParsableVersionFailsErrorWithCode()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4287,7 +4286,7 @@ public void PackCommand_PackLicense_ExpressionVersionHigherFailsWithErrorCode()
// Set up
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4299,8 +4298,8 @@ public void PackCommand_PackLicense_ExpressionVersionHigherFailsWithErrorCode()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4323,7 +4322,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile(string licenseFileName,
// Set up
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var licenseFile = Path.Combine(workingDirectory, licenseFileName);
@@ -4353,8 +4352,8 @@ public void PackCommand_PackLicense_PackBasicLicenseFile(string licenseFileName,
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4390,7 +4389,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileNotInPackage()
var licenseFileName = "LICENSE.txt";
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var licenseFile = Path.Combine(workingDirectory, licenseFileName);
@@ -4406,8 +4405,8 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileNotInPackage()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4427,7 +4426,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileIncorrectCasing()
var nuspecLicenseFileName = "License.txt";
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var licenseFile = Path.Combine(workingDirectory, realLicenseFileName);
@@ -4456,8 +4455,8 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileIncorrectCasing()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5030.ToString(), result.Output);
Assert.Contains($"'{realLicenseFileName}'", result.Output, StringComparison.Ordinal); // Check for "Did you mean 'LICENSE.txt'?"
@@ -4473,7 +4472,7 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileExtensionNotValid()
// Set up
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var licenseFile = Path.Combine(workingDirectory, licenseFileName);
@@ -4489,8 +4488,8 @@ public void PackCommand_PackLicense_PackBasicLicenseFile_FileExtensionNotValid()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4510,7 +4509,7 @@ public void PackCommand_PackLicense_BothLicenseExpressionAndFile_FailsWithErrorC
var licenseExpr = "MIT";
var licenseFile = "LICENSE.txt";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4522,8 +4521,8 @@ public void PackCommand_PackLicense_BothLicenseExpressionAndFile_FailsWithErrorC
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4543,7 +4542,7 @@ public void PackCommand_PackLicense_LicenseUrlIsBeingDeprecated()
var projectName = "ClassLibrary1";
var projectUrl = new Uri("https://www.coolproject.com/license.txt");
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4554,8 +4553,8 @@ public void PackCommand_PackLicense_LicenseUrlIsBeingDeprecated()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4588,7 +4587,7 @@ public void PackCommand_PackLicense_IncludeLicenseFileWithSnupkg()
var projectName = "ClassLibrary1";
var licenseFileName = "LICENSE.txt";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var licenseFile = Path.Combine(workingDirectory, licenseFileName);
File.WriteAllText(licenseFile, "Random licenseFile");
@@ -4614,9 +4613,9 @@ public void PackCommand_PackLicense_IncludeLicenseFileWithSnupkg()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=snupkg -o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=snupkg -o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -4672,7 +4671,7 @@ public void PackCommand_PackLicense_IncludeLicenseFileWithSymbolsNupkg()
var projectName = "ClassLibrary1";
var licenseFileName = "LICENSE.txt";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
var licenseFile = Path.Combine(workingDirectory, licenseFileName);
File.WriteAllText(licenseFile, "Random licenseFile");
@@ -4698,9 +4697,9 @@ public void PackCommand_PackLicense_IncludeLicenseFileWithSymbolsNupkg()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=symbols.nupkg -o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"--include-symbols /p:SymbolPackageFormat=symbols.nupkg -o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
@@ -4755,7 +4754,7 @@ public void PackCommand_PackLicense_LicenseExpressionAndLicenseUrlInConjunction(
var projectName = "ClassLibrary1";
var licenseExpr = "MIT";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup LicenseExpression
@@ -4767,8 +4766,8 @@ public void PackCommand_PackLicense_LicenseExpressionAndLicenseUrlInConjunction(
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -4786,7 +4785,7 @@ public void PackCommand_PackEmbedInteropPackage()
{
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Setup BuildOutputTargetFolder
@@ -4799,8 +4798,8 @@ public void PackCommand_PackEmbedInteropPackage()
}
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -4843,7 +4842,7 @@ public void PackCommand_PackProject_PacksFrameworkReferences(string frameworkRef
frameworkReftoPack.Add(frameworkRefs[i], pack[i]);
}
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -4877,11 +4876,11 @@ public void PackCommand_PackProject_PacksFrameworkReferences(string frameworkRef
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -4937,7 +4936,7 @@ public void PackCommand_WithGeneratePackageOnBuildSet_CanPublish()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " console", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " console", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -4947,7 +4946,7 @@ public void PackCommand_WithGeneratePackageOnBuildSet_CanPublish()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
// Assert
- _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"publish {projectFile}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"publish {projectFile}", logLine: _testOutputHelper.WriteLine);
}
}
@@ -4958,7 +4957,7 @@ public void PackCommand_Deterministic_MultiplePackInvocations_CreateIdenticalPac
{
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -4968,7 +4967,7 @@ public void PackCommand_Deterministic_MultiplePackInvocations_CreateIdenticalPac
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Act
byte[][] packageBytes = new byte[2][];
@@ -4979,7 +4978,7 @@ public void PackCommand_Deterministic_MultiplePackInvocations_CreateIdenticalPac
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
// Act
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {packageOutputPath}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {packageOutputPath}", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
Assert.True(File.Exists(nuspecPath), "The intermediate nuspec file is not in the expected place");
@@ -5032,7 +5031,7 @@ public void PackCommand_PackageIcon_HappyPath_Warns_Succeeds()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
// Validate embedded icon in package
ValidatePackIcon(projectBuilder);
@@ -5061,7 +5060,7 @@ public void PackCommand_PackageIcon_MissingFile_Fails()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5046.ToString(), result.Output);
}
@@ -5084,7 +5083,7 @@ public void PackCommand_PackageIcon_IncorrectCasing_Fails()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5046.ToString(), result.Output);
Assert.Contains("'icon.jpg'", result.Output, StringComparison.Ordinal); // Check for "Did you mean 'icon.jpg'?"
@@ -5108,7 +5107,7 @@ public void PackCommand_PackageIcon_IncorrectFolderCasing_Fails()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5046.ToString(), result.Output);
Assert.Contains("'folder/icon.jpg'", result.Output, StringComparison.Ordinal); // Check for "Did you mean 'folder/icon.jpg'?"
@@ -5138,7 +5137,7 @@ public void PackCommand_PackageIcon_PackWithSymbols_Succeeds(string symbolPackag
projectBuilder.ProjectFolder,
projectBuilder.ProjectName,
$"--include-symbols /p:SymbolPackageFormat={symbolPackageFormat}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
}
}
@@ -5166,7 +5165,7 @@ public void PackCommand_PackIcon_WithNuspec_IconUrl_Warns_Succeeds()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5048.ToString(), result.Output);
Assert.Contains("iconUrl", result.Output);
@@ -5183,7 +5182,7 @@ public void PackCommand_WhenUsingSemver2Version_NU5105_IsNotRaised()
var workingDirectory = Path.Combine(testDirectory, projectName);
Directory.CreateDirectory(workingDirectory);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -5193,12 +5192,12 @@ public void PackCommand_WhenUsingSemver2Version_NU5105_IsNotRaised()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
- var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(nupkgPath), $"The output .nupkg is not in the expected place. {result.AllOutput}");
Assert.True(File.Exists(nuspecPath), $"The intermediate nuspec file is not in the expected place. {result.AllOutput}");
@@ -5219,7 +5218,7 @@ public void PackCommand_PackProjectWithCentralTransitiveDependencies(string Cent
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
// Act
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib -f netstandard2.0", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -5263,8 +5262,8 @@ public void PackCommand_PackProjectWithCentralTransitiveDependencies(string Cent
";
File.WriteAllText(directoryPackagesPropsName, directoryPackagesPropsContent);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", "obj", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", "obj", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -5342,7 +5341,7 @@ public void PackCommand_PackageReadmeFile_BasicFunc_Succeeds()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
// Validate embedded readme in package
ValidatePackReadme(projectBuilder);
@@ -5374,7 +5373,7 @@ public void PackCommand_PackageReadmeFile_MissingReadmeFileInPackage_Fails()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5039.ToString(), result.Output);
}
@@ -5394,7 +5393,7 @@ public void PackCommand_PackageReadmeFile_MissingReadmeFileInFolder_Fails()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5019.ToString(), result.Output);
}
@@ -5417,7 +5416,7 @@ public void PackCommand_PackageReadmeFile_IncorrectReadmeExtension_Fails()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5038.ToString(), result.Output);
}
@@ -5440,7 +5439,7 @@ public void PackCommand_PackageReadmeFile_ReadmeFileIsEmpty_Fails()
using (var srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.PackProjectExpectFailure(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
Assert.Contains(NuGetLogCode.NU5040.ToString(), result.Output);
}
@@ -5476,7 +5475,7 @@ public void PackCommand_PackageReadmeFile_BasicFunc_WithSymbol_Succeeds()
using (TestDirectory srcDir = _dotnetFixture.Build(testDirBuilder))
{
projectBuilder.Build(_dotnetFixture, srcDir.Path);
- _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(projectBuilder.ProjectFolder, projectBuilder.ProjectName, logLine: _testOutputHelper.WriteLine);
// Assert
// Validate embedded readme in package
@@ -5520,7 +5519,7 @@ public void PackCommand_DoesNotGenerateOwnersElement()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -5532,8 +5531,8 @@ public void PackCommand_DoesNotGenerateOwnersElement()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -5557,7 +5556,7 @@ public void PackCommand_RequireLicenseAcceptanceNotEmittedWhenUnspecified()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
XDocument xml;
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -5568,10 +5567,10 @@ public void PackCommand_RequireLicenseAcceptanceNotEmittedWhenUnspecified()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Test without a license
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -5590,7 +5589,7 @@ public void PackCommand_RequireLicenseAcceptanceNotEmittedWhenUnspecified()
using (var stream = File.Create(projectFile))
ProjectFileUtils.WriteXmlToFile(xml, stream);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
document = XDocument.Load(nuspecPath);
Assert.Null(document.Root.Element(ns + "metadata").Element(ns + "requireLicenseAcceptance"));
@@ -5606,7 +5605,7 @@ public void PackCommand_RequireLicenseAcceptanceNotEmittedWhenSpecifiedAsDefault
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
XDocument xml;
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
@@ -5619,10 +5618,10 @@ public void PackCommand_RequireLicenseAcceptanceNotEmittedWhenSpecifiedAsDefault
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
// Test without a license
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -5641,7 +5640,7 @@ public void PackCommand_RequireLicenseAcceptanceNotEmittedWhenSpecifiedAsDefault
using (var stream = File.Create(projectFile))
ProjectFileUtils.WriteXmlToFile(xml, stream);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
document = XDocument.Load(nuspecPath);
Assert.Null(document.Root.Element(ns + "metadata").Element(ns + "requireLicenseAcceptance"));
@@ -5657,7 +5656,7 @@ public void PackCommand_RequireLicenseAcceptanceEmittedWhenSpecifiedAsTrue()
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -5670,8 +5669,8 @@ public void PackCommand_RequireLicenseAcceptanceEmittedWhenSpecifiedAsTrue()
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
var nuspecPath = Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec");
@@ -5707,8 +5706,8 @@ public void Dotnet_New_Template_Restore_Pack_Success(string template)
string nupkgPath = Path.Combine(solutionDirectory, "bin", "Debug", $"{projectName}.1.0.0.nupkg");
// Act
- _dotnetFixture.CreateDotnetNewProject(workDirectory, projectName, template, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(solutionDirectory, projectName, string.Empty, null, testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(workDirectory, projectName, template, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(solutionDirectory, projectName, string.Empty, null, logLine: _testOutputHelper.WriteLine);
// Assert
// Make sure restore action was success.
@@ -5735,7 +5734,7 @@ public async Task PackCommand_PrereleaseDependency_SucceedAndLogsWarning()
string testDirectory = pathContext.WorkingDirectory;
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
string projectXml = $@"
{TestConstants.DefaultTargetFramework.GetShortFolderName()}
@@ -5749,8 +5748,8 @@ public async Task PackCommand_PrereleaseDependency_SucceedAndLogsWarning()
File.WriteAllText(projectFile, projectXml);
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3.nupkg");
@@ -5777,7 +5776,7 @@ public async Task PackCommand_PrereleaseDependency_WarningSuppressed_Succeed()
string testDirectory = pathContext.WorkingDirectory;
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
string projectXml = $@"
{TestConstants.DefaultTargetFramework.GetShortFolderName()}
@@ -5790,8 +5789,8 @@ public async Task PackCommand_PrereleaseDependency_WarningSuppressed_Succeed()
File.WriteAllText(projectFile, projectXml);
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3.nupkg");
@@ -5846,7 +5845,7 @@ public async Task PackCommand_PrereleaseDependencies_PartialWarningSuppressed_Su
string testDirectory = pathContext.WorkingDirectory;
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
string projectXml = $@"
{TestConstants.DefaultTargetFramework.GetShortFolderName()}
@@ -5862,8 +5861,8 @@ public async Task PackCommand_PrereleaseDependencies_PartialWarningSuppressed_Su
File.WriteAllText(projectFile, projectXml);
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3.nupkg");
@@ -5891,7 +5890,7 @@ public async Task PackCommand_PrereleaseDependency_ProjectLevelWarningSuppressed
string testDirectory = pathContext.WorkingDirectory;
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
string projectXml = $@"
{TestConstants.DefaultTargetFramework.GetShortFolderName()}
@@ -5907,8 +5906,8 @@ public async Task PackCommand_PrereleaseDependency_ProjectLevelWarningSuppressed
File.WriteAllText(projectFile, projectXml);
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3.nupkg");
@@ -5968,7 +5967,7 @@ public async Task PackCommand_MultiTfm_PrereleaseDependency_TreatWarningsAsError
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
string projectXml = $@"
{TestConstants.ProjectTargetFramework};net45
@@ -5987,8 +5986,8 @@ public async Task PackCommand_MultiTfm_PrereleaseDependency_TreatWarningsAsError
File.WriteAllText(projectFile, projectXml);
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3.nupkg");
@@ -6027,7 +6026,7 @@ public async Task PackCommand_MultiTfm_PrereleaseDependency_WarningIsSuppressed_
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
string projectXml = $@"
{TestConstants.ProjectTargetFramework};net45
@@ -6046,8 +6045,8 @@ public async Task PackCommand_MultiTfm_PrereleaseDependency_WarningIsSuppressed_
File.WriteAllText(projectFile, projectXml);
// Act
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3.nupkg");
@@ -6109,7 +6108,7 @@ public async Task PackCommand_MultiTfm_PrereleaseDependency_ProjectLevelWarningS
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory, projectName, args: "classlib", logLine: _testOutputHelper.WriteLine);
string projectXml = $@"
{TestConstants.DefaultTargetFramework.GetShortFolderName()};net48
@@ -6126,7 +6125,7 @@ public async Task PackCommand_MultiTfm_PrereleaseDependency_ProjectLevelWarningS
File.WriteAllText(projectFile, projectXml);
// Act
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
// Assert
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.2.3.nupkg");
@@ -6166,7 +6165,7 @@ public void PackCommand_WithAllWarningsAsErrorsAndWarningsNotAsErrors_SucceedsAn
var workingDirectory = Path.Combine(testDirectory, projectName);
Directory.CreateDirectory(workingDirectory);
var projectFile = Path.Combine(workingDirectory, $"{projectName}.csproj");
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
using (var stream = new FileStream(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -6177,7 +6176,7 @@ public void PackCommand_WithAllWarningsAsErrorsAndWarningsNotAsErrors_SucceedsAn
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
Assert.True(File.Exists(Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg")), "The output .nupkg is not in the expected place");
Assert.True(File.Exists(Path.Combine(workingDirectory, "obj", $"{projectName}.1.0.0.nuspec")), "The intermediate nuspec file is not in the expected place");
var expectedWarning = string.Format("warning " + NuGetLogCode.NU5125 + ": " + NuGet.Packaging.Rules.AnalysisResources.LicenseUrlDeprecationWarning);
@@ -6200,7 +6199,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource,
},
new SimpleTestPackageContext("Z", "2.0.0"));
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -6234,13 +6233,13 @@ await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource,
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
LockFile assetsFile = new LockFileFormat().Read(Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName));
assetsFile.Targets.Should().HaveCount(1);
assetsFile.Targets[0].Libraries.Should().HaveCount(3);
- CommandRunnerResult packResult = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult packResult = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
using var nupkgReader = new PackageArchiveReader(nupkgPath);
List dependencyGroups = nupkgReader.NuspecReader.GetDependencyGroups().ToList();
@@ -6274,7 +6273,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource,
},
new SimpleTestPackageContext("Z", "2.0.0"));
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -6309,14 +6308,14 @@ await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource,
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
LockFile assetsFile = new LockFileFormat().Read(Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName));
assetsFile.Targets.Should().HaveCount(2);
assetsFile.Targets[0].Libraries.Should().HaveCount(3);
assetsFile.Targets[1].Libraries.Should().HaveCount(3);
- CommandRunnerResult packResult = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult packResult = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
using var nupkgReader = new PackageArchiveReader(nupkgPath);
List dependencyGroups = nupkgReader.NuspecReader.GetDependencyGroups().ToList();
@@ -6342,7 +6341,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource,
},
new SimpleTestPackageContext("Z", "2.0.0"));
- _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(pathContext.SolutionRoot, projectName, "classlib -f netstandard2.1", logLine: _testOutputHelper.WriteLine);
using (var stream = File.Open(projectFile, FileMode.Open, FileAccess.ReadWrite))
{
@@ -6377,14 +6376,14 @@ await SimpleTestPackageUtility.CreatePackagesAsync(pathContext.PackageSource,
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", testOutputHelper: _testOutputHelper);
+ var result = _dotnetFixture.RunDotnetExpectSuccess(workingDirectory, $"restore {projectFile}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().NotContain("Warning");
LockFile assetsFile = new LockFileFormat().Read(Path.Combine(workingDirectory, "obj", LockFileFormat.AssetsFileName));
assetsFile.Targets.Should().HaveCount(2);
assetsFile.Targets[0].Libraries.Should().HaveCount(3);
assetsFile.Targets[1].Libraries.Should().HaveCount(3);
- CommandRunnerResult packResult = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", testOutputHelper: _testOutputHelper);
+ CommandRunnerResult packResult = _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"/p:PackageOutputPath={workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
using var nupkgReader = new PackageArchiveReader(nupkgPath);
List dependencyGroups = nupkgReader.NuspecReader.GetDependencyGroups().ToList();
@@ -6406,11 +6405,11 @@ public void PackCommand_AliasedFrameworks_NoMitigation_FailsWithNU5051()
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
SetupAliasedFrameworkProject(workingDirectory, projectName);
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("NU5051");
}
@@ -6424,12 +6423,12 @@ public void PackCommand_AliasedFrameworks_OnlyIncludeBuildOutputFalse_FailsWithN
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
SetupAliasedFrameworkProject(workingDirectory, projectName,
bananaIncludeBuildOutput: "false");
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("NU5051");
}
@@ -6443,12 +6442,12 @@ public void PackCommand_AliasedFrameworks_OnlySuppressDependencies_FailsWithNU50
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
SetupAliasedFrameworkProject(workingDirectory, projectName,
bananaSuppressDependencies: "true");
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("NU5051");
}
@@ -6462,13 +6461,13 @@ public void PackCommand_AliasedFrameworks_IncludeBuildOutputFalseAndSuppressDepe
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
SetupAliasedFrameworkProject(workingDirectory, projectName,
bananaIncludeBuildOutput: "false",
bananaSuppressDependencies: "true");
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ _dotnetFixture.PackProjectExpectSuccess(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
var nupkgPath = Path.Combine(workingDirectory, $"{projectName}.1.0.0.nupkg");
Assert.True(File.Exists(nupkgPath), "The output .nupkg is not in the expected place");
@@ -6493,7 +6492,7 @@ public void PackCommand_AliasedFrameworks_DifferentFrameworkReferences_FailsWith
var projectName = "ClassLibrary1";
var workingDirectory = Path.Combine(testDirectory, projectName);
- _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.CreateDotnetNewProject(testDirectory.Path, projectName, " classlib", logLine: _testOutputHelper.WriteLine);
SetupAliasedFrameworkProject(workingDirectory, projectName,
bananaIncludeBuildOutput: "false",
bananaSuppressDependencies: "true");
@@ -6508,8 +6507,8 @@ public void PackCommand_AliasedFrameworks_DifferentFrameworkReferences_FailsWith
ProjectFileUtils.WriteXmlToFile(xml, stream);
}
- _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, testOutputHelper: _testOutputHelper);
- var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", testOutputHelper: _testOutputHelper);
+ _dotnetFixture.RestoreProjectExpectSuccess(workingDirectory, projectName, logLine: _testOutputHelper.WriteLine);
+ var result = _dotnetFixture.PackProjectExpectFailure(workingDirectory, projectName, $"-o {workingDirectory}", logLine: _testOutputHelper.WriteLine);
result.AllOutput.Should().Contain("NU5051");
}
diff --git a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/X509TrustStoreTests.cs b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/X509TrustStoreTests.cs
index 81c52536c24..46a833549e2 100644
--- a/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/X509TrustStoreTests.cs
+++ b/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/X509TrustStoreTests.cs
@@ -11,7 +11,6 @@
using NuGet.Packaging.Signing;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Dotnet.Integration.Test
{
diff --git a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/GenerateRestoreGraphFileTargetTests.cs b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/GenerateRestoreGraphFileTargetTests.cs
index 5c4fbc748d5..76ecb5f12b6 100644
--- a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/GenerateRestoreGraphFileTargetTests.cs
+++ b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/GenerateRestoreGraphFileTargetTests.cs
@@ -7,7 +7,6 @@
using NuGet.Frameworks;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Msbuild.Integration.Test
{
@@ -57,8 +56,8 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var standardDgSpecFile = Path.Combine(pathContext.WorkingDirectory, "standard.dgspec.json");
var staticGraphDgSpecFile = Path.Combine(pathContext.WorkingDirectory, "staticGraph.dgspec.json");
var targetPath = projectA.ProjectPath;
- _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{standardDgSpecFile}\" {targetPath}", testOutputHelper: _testOutputHelper);
- _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{staticGraphDgSpecFile}\" /p:RestoreUseStaticGraphEvaluation=true {targetPath}", testOutputHelper: _testOutputHelper);
+ _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{standardDgSpecFile}\" {targetPath}", logLine: _testOutputHelper.WriteLine);
+ _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=\"{staticGraphDgSpecFile}\" /p:RestoreUseStaticGraphEvaluation=true {targetPath}", logLine: _testOutputHelper.WriteLine);
var regularDgSpec = File.ReadAllText(standardDgSpecFile);
var staticGraphDgSpec = File.ReadAllText(staticGraphDgSpecFile);
diff --git a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildIntegrationTestFixture.cs b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildIntegrationTestFixture.cs
index 42b55da4113..58a408360c5 100644
--- a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildIntegrationTestFixture.cs
+++ b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildIntegrationTestFixture.cs
@@ -10,7 +10,6 @@
using FluentAssertions;
using Microsoft.Internal.NuGet.Testing.SignedPackages.ChildProcess;
using NuGet.Common;
-using Xunit.Abstractions;
namespace Msbuild.Integration.Test
{
@@ -100,7 +99,7 @@ string FindMsbuildWithVsWhere()
///
/// msbuild.exe args
///
- internal CommandRunnerResult RunMsBuild(string workingDirectory, string args, bool ignoreExitCode = false, ITestOutputHelper testOutputHelper = null, IReadOnlyDictionary environmentVariables = null)
+ internal CommandRunnerResult RunMsBuild(string workingDirectory, string args, bool ignoreExitCode = false, Action logLine = null, IReadOnlyDictionary environmentVariables = null)
{
var restoreDllPath = Path.Combine(_testDir, "NuGet.Build.Tasks.dll");
var nugetRestorePropsPath = Path.Combine(_testDir, "NuGet.props");
@@ -110,7 +109,7 @@ internal CommandRunnerResult RunMsBuild(string workingDirectory, string args, bo
workingDirectory,
$"/p:NuGetPropsFile={nugetRestorePropsPath} /p:NuGetRestoreTargets={nugetRestoreTargetsPath} /p:RestoreTaskAssemblyFile={restoreDllPath} /p:ImportNuGetBuildTasksPackTargetsFromSdk=true {args}",
environmentVariables: environmentVariables ?? DefaultProcessEnvironmentVariables,
- testOutputHelper: testOutputHelper);
+ logLine: logLine);
if (!ignoreExitCode)
{
diff --git a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskPackageSourceMappingTests.cs b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskPackageSourceMappingTests.cs
index a2153463427..2879e034156 100644
--- a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskPackageSourceMappingTests.cs
+++ b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskPackageSourceMappingTests.cs
@@ -10,7 +10,6 @@
using NuGet.ProjectModel;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Msbuild.Integration.Test
{
@@ -125,7 +124,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -225,7 +224,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, result.ExitCode);
@@ -335,7 +334,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -435,7 +434,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, result.ExitCode);
@@ -547,7 +546,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -643,7 +642,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, result.ExitCode);
@@ -737,7 +736,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
}
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, result.ExitCode);
@@ -792,7 +791,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageContosoMvcReal);
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -874,7 +873,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageContosoMvcReal);
// Act
- var r = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var r = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(0, r.ExitCode);
@@ -960,7 +959,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageContosoMvcReal);
// Act
- var r = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var r = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore -v:d {pathContext.SolutionRoot}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, r.ExitCode);
diff --git a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskTests.cs b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskTests.cs
index 58cf9721beb..fcc61bdc609 100644
--- a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskTests.cs
+++ b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskTests.cs
@@ -22,7 +22,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
using static NuGet.Frameworks.FrameworkConstants;
namespace Msbuild.Integration.Test
@@ -87,7 +86,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
string args = $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore}";
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, testOutputHelper: _testOutputHelper, environmentVariables);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, logLine: _testOutputHelper.WriteLine, environmentVariables);
// Assert
Assert.True(result.ExitCode == 0, result.AllOutput);
@@ -136,7 +135,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
@@ -192,7 +191,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, result.ExitCode);
@@ -247,7 +246,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
@@ -306,7 +305,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
@@ -372,7 +371,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {projectA.ProjectPath} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {projectA.ProjectPath} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
@@ -434,7 +433,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var pkgPath = Path.Combine(pathContext.SolutionRoot, "packages", "x.1.0.0");
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
@@ -494,7 +493,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Restore the project with a PackageReference which generates assets
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true /p:RestoreCleanupAssetsForUnsupportedProjects={cleanupAssetsForUnsupportedProjects} {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true /p:RestoreCleanupAssetsForUnsupportedProjects={cleanupAssetsForUnsupportedProjects} {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
Assert.True(result.ExitCode == 0, result.AllOutput);
@@ -521,7 +520,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
projectA.Save();
// Restore the project with a PackageReference which generates assets
- result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true /p:RestoreCleanupAssetsForUnsupportedProjects={cleanupAssetsForUnsupportedProjects} {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true /p:RestoreCleanupAssetsForUnsupportedProjects={cleanupAssetsForUnsupportedProjects} {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(result.ExitCode == 0, result.AllOutput);
@@ -586,7 +585,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var projectOutputTimestamps = new Dictionary();
// Restore the project with a PackageReference which generates assets
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
result.Success.Should().BeTrue(because: result.AllOutput);
foreach (var asset in projectOutputPaths)
@@ -601,7 +600,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
environmentVariables["NUGET_USE_NEW_PACKAGESPEC_FACTORY"] = usePackageSpecFactory.ToString();
// Restore the project with a PackageReference which generates assets
- result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true {project.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper, environmentVariables);
+ result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true {project.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine, environmentVariables);
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -612,7 +611,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
fileInfo.LastWriteTimeUtc.Should().Be(projectOutputTimestamps[asset]);
}
- result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper, environmentVariables);
+ result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine, environmentVariables);
result.Success.Should().BeTrue(result.AllOutput);
}
}
@@ -667,7 +666,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
environmentVariables["NUGET_USE_NEW_PACKAGESPEC_FACTORY"] = usePackageSpecFactory.ToString();
// Restore the project with a PackageReference which generates assets
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true {project.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper, environmentVariables);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true {project.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine, environmentVariables);
result.Success.Should().BeFalse(because: result.AllOutput);
@@ -729,7 +728,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath} /p:RestoreSources=\"{relativePath}\"" +
(isStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty),
ignoreExitCode: true,
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables);
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -760,7 +759,7 @@ public Task MsbuildRestore_WithStaticGraphRestore_MessageLoggedAtDefaultVerbosit
var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestoreUseStaticGraphEvaluation=true",
ignoreExitCode: true,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.Success.Should().BeTrue(because: result.AllOutput);
result.AllOutput.Should().Contain("The solution did not have any projects to restore, ensure that all projects are known to " +
@@ -794,7 +793,7 @@ public Task MsbuildRestore_WithStaticGraphRestore_MessageLoggedAtDefaultVerbosit
var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestoreUseStaticGraphEvaluation=true",
ignoreExitCode: true,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
result.Success.Should().BeTrue(because: result.AllOutput);
result.AllOutput.Should().Contain($"The solution contains '{solution.Projects.Count}' project(s) '{project.ProjectName}' that are not known to MSBuild. " +
@@ -837,7 +836,7 @@ public void MsbuildRestore_StaticGraphEvaluation_HandlesInvalidProjectFileExcept
File.Delete(projectB.ProjectPath);
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation=true {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.True(result.ExitCode == 1, result.AllOutput);
@@ -891,7 +890,7 @@ public async Task MsbuildRestore_WithMissingProjectReferences_HandlesProjectRefe
environmentVariables.AddRange(_msbuildFixture.DefaultProcessEnvironmentVariables);
environmentVariables["NUGET_USE_NEW_PACKAGESPEC_FACTORY"] = usePackageSpecFactory.ToString();
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={restoreUseStaticGraphEvaluation} {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper, environmentVariables);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={restoreUseStaticGraphEvaluation} {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine, environmentVariables);
// Assert
result.ExitCode.Should().Be(0, result.AllOutput);
@@ -919,7 +918,7 @@ public void MsbuildRestore_WithUnsupportedProjects_WarnsOrLogsMessage(bool resto
project.ProjectPath,
@"");
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={restoreUseStaticGraphEvaluation} {solution.SolutionPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={restoreUseStaticGraphEvaluation} {solution.SolutionPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
result.ExitCode.Should().Be(0, result.AllOutput);
@@ -968,7 +967,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory,
$"/t:restore {pathContext.SolutionRoot}" + (isStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty),
- testOutputHelper: _testOutputHelper,
+ logLine: _testOutputHelper.WriteLine,
environmentVariables: environmentVariables);
// Assert
@@ -1008,7 +1007,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Projects.Add(projectA);
solution.Create();
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1073,7 +1072,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Projects.Add(projectA);
solution.Create();
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1126,7 +1125,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
solution.Projects.Add(projectA);
solution.Create();
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1167,7 +1166,7 @@ public void MsbuildRestore_WithCPPCliVcxproj_WithProjectReferenceAndWindowsWindo
solution.Create();
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot}", logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1226,7 +1225,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
// Act
string args = $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true /p:RestoreUseStaticGraphEvaluation={useStaticGraphEvaluation}";
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, result.ExitCode);
@@ -1278,7 +1277,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX);
// Act
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
@@ -1365,7 +1364,7 @@ public async Task MsbuildRestore_WithWarningsNotAsErrors_SucceedsAndRaisesWarnin
projectA.Properties.Add("WarningsNotAsErrors", "NU1603");
solution.Projects.Add(projectA);
solution.Create();
- CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1406,7 +1405,7 @@ public void MsbuildRestore_WithLegacyCsproj_GlobalPackageReferencesAreProcessed(
");
- CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/NoAutoResponse /NoLogo /ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign /Target:PrintPackageReferences {projectPath}", ignoreExitCode: false, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/NoAutoResponse /NoLogo /ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign /Target:PrintPackageReferences {projectPath}", ignoreExitCode: false, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1458,7 +1457,7 @@ public async Task MsbuildRestore_LegacyCsprojWithCpm_GlobalPackageReferencesAreP
File.WriteAllText(directoryPackagesPropsPath, directoryPackagesProps);
// Act
- CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1496,7 +1495,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
packageX150);
// Pre-Conditions
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
result.Success.Should().BeTrue(because: result.AllOutput);
DateTime assetsFileWriteTime = GetFileLastWriteTime(project.AssetsFileOutputPath);
var logMessages = project.AssetsFile.LogMessages;
@@ -1506,7 +1505,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
string oldLockFile = File.ReadAllText(project.AssetsFileOutputPath);
// Act
- result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreForce=true {project.ProjectPath}", testOutputHelper: _testOutputHelper);
+ result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreForce=true {project.ProjectPath}", logLine: _testOutputHelper.WriteLine);
// Assert
string newLockFile = File.ReadAllText(project.AssetsFileOutputPath);
@@ -1606,7 +1605,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
mockServer.Start();
string args = $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true";
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
mockServer.Stop();
@@ -1687,7 +1686,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
// Act
string args = $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true";
- CommandRunnerResult r = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult r = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
mockServer.Stop();
@@ -1797,7 +1796,7 @@ public async Task MsbuildRestore_WithPackagesConfigProject_PackageWithVulnerabil
mockServer.Start();
string args = $"/t:restore {pathContext.SolutionRoot} /p:RestorePackagesConfig=true";
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, args, ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
mockServer.Stop();
@@ -1859,7 +1858,7 @@ public async Task MsBuildRestore_WithCPMDisabled_IndividualProjectCanEnableCPM(b
solution.Create();
// Act
- CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue();
@@ -1898,7 +1897,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath} /p:RestoreUseLegacyDependencyResolver=true" +
(isStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty),
ignoreExitCode: true,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -1946,7 +1945,7 @@ public async Task MsbuildRestore_WithPackageReferenceAndPackageVersion_RaisesNU1
environmentVariables.Add("NUGET_USE_NEW_PACKAGESPEC_FACTORY", usePackageSpecFactory.ToString());
// Act
- CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper, environmentVariables);
+ CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine, environmentVariables);
// Assert
result.Success.Should().BeFalse(because: result.AllOutput);
@@ -1990,7 +1989,7 @@ public async Task MsbuildRestore_WithDifferentCasingInPackageReferenceAndPackage
File.WriteAllText(directoryPackagesPropsPath, directoryPackagesProps);
// Act
- CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, testOutputHelper: _testOutputHelper);
+ CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore /p:RestoreUseStaticGraphEvaluation={useStaticGraphRestore} {projectA.ProjectPath}", ignoreExitCode: true, logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -2046,7 +2045,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath} " +
(isStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty),
ignoreExitCode: true,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -2107,7 +2106,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath} " +
(isStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=true" : string.Empty),
ignoreExitCode: true,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -2145,7 +2144,7 @@ public void MsbuildRestore_StaticGraphRestore_CanReadSolutionFiles(bool useSlnx)
CommandRunnerResult result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory,
$"/t:restore {project.ProjectPath} /p:RestoreUseStaticGraphEvaluation=true /p:RestoreProjectStyle=PackageReference",
ignoreExitCode: true,
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
result.Success.Should().BeTrue(because: result.AllOutput);
@@ -2206,7 +2205,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async(
environmentVariables.AddRange(_msbuildFixture.DefaultProcessEnvironmentVariables);
environmentVariables["NUGET_USE_NEW_PACKAGESPEC_FACTORY"] = usePackageSpecFactory.ToString();
- var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}" + (useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=\"true\"" : string.Empty), ignoreExitCode: true, testOutputHelper: _testOutputHelper, environmentVariables);
+ var result = _msbuildFixture.RunMsBuild(pathContext.WorkingDirectory, $"/t:restore {project.ProjectPath}" + (useStaticGraphRestore ? " /p:RestoreUseStaticGraphEvaluation=\"true\"" : string.Empty), ignoreExitCode: true, logLine: _testOutputHelper.WriteLine, environmentVariables);
result.Success.Should().BeTrue(because: result.AllOutput);
foreach (var asset in projectOutputPaths)
diff --git a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/NuGetPropertyDefaultsTests.cs b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/NuGetPropertyDefaultsTests.cs
index 8bc68e7b02e..d5ae2c2f0a3 100644
--- a/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/NuGetPropertyDefaultsTests.cs
+++ b/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/NuGetPropertyDefaultsTests.cs
@@ -6,7 +6,6 @@
using NuGet.Frameworks;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace Msbuild.Integration.Test
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.Packaging.FuncTest/SigningTests/SignatureTrustAndValidityVerificationProviderTests.cs b/test/NuGet.Core.FuncTests/NuGet.Packaging.FuncTest/SigningTests/SignatureTrustAndValidityVerificationProviderTests.cs
index 4f27a4ee891..dcb3b3ea854 100644
--- a/test/NuGet.Core.FuncTests/NuGet.Packaging.FuncTest/SigningTests/SignatureTrustAndValidityVerificationProviderTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.Packaging.FuncTest/SigningTests/SignatureTrustAndValidityVerificationProviderTests.cs
@@ -18,7 +18,6 @@
using Test.Utility;
using Test.Utility.Signing;
using Xunit;
-using Xunit.Abstractions;
using HashAlgorithmName = NuGet.Common.HashAlgorithmName;
namespace NuGet.Packaging.FuncTest
diff --git a/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/AuthenticationHandlerTests.cs b/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/AuthenticationHandlerTests.cs
index 20d664f68bd..84ad1bb75b5 100644
--- a/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/AuthenticationHandlerTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/AuthenticationHandlerTests.cs
@@ -16,7 +16,6 @@
using NuGet.Configuration;
using NuGet.Protocol.Core.Types;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Protocol.FuncTest
{
@@ -314,6 +313,15 @@ public void HandleHttpRequest(IAsyncResult result)
_output.WriteLine($"Got request for {context.Request.Url}. Auth: {authorization}");
}
+ catch (HttpListenerException)
+ {
+ // The listener was stopped/disposed between the IsListening check and EndGetContext.
+ return;
+ }
+ catch (ObjectDisposedException)
+ {
+ return;
+ }
catch (Exception ex)
{
if (context != null)
@@ -336,6 +344,10 @@ public void HandleHttpRequest(IAsyncResult result)
{
// .NET 5 throws here, whereas .NET Framework triggers the callback where we can check IsListening == false
}
+ catch (HttpListenerException)
+ {
+ // The listener was stopped/disposed between the IsListening check and BeginGetContext.
+ }
catch (InvalidOperationException)
{
// Sometimes BeginGetContext throws when httpListener is stopped. Possibly race condition between this callback
diff --git a/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/PluginTests.cs b/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/PluginTests.cs
index 93e4556bee1..a0350204374 100644
--- a/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/PluginTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/PluginTests.cs
@@ -12,7 +12,7 @@
using System.Threading;
using System.Threading.Tasks;
using NuGet.Protocol.Plugins;
-using Xunit.Abstractions;
+using Xunit;
#if IS_DESKTOP
using System.Globalization;
@@ -20,7 +20,6 @@
using Newtonsoft.Json.Linq;
using NuGet.Packaging;
using NuGet.Test.Utility;
-using Xunit;
using PluginProtocolConstants = NuGet.Protocol.Plugins.ProtocolConstants;
#endif
diff --git a/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/Scenarios/ServerReturnsWrongPackageTests.cs b/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/Scenarios/ServerReturnsWrongPackageTests.cs
index 57321183312..f11e7ff6433 100644
--- a/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/Scenarios/ServerReturnsWrongPackageTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/Scenarios/ServerReturnsWrongPackageTests.cs
@@ -182,7 +182,7 @@ public class Fixture : IAsyncLifetime
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
- public async Task InitializeAsync()
+ public async ValueTask InitializeAsync()
{
_packageBytes = await GetPackageBytesAsync(ActualPackageName);
Responses = GetResponsesDictionary();
@@ -239,10 +239,10 @@ await PackageExtractor.ExtractPackageAsync(
File.WriteAllBytes(v2NupkgPath, _packageBytes);
}
- public Task DisposeAsync()
+ public ValueTask DisposeAsync()
{
_testDirectory?.Dispose();
- return Task.CompletedTask;
+ return default;
}
private static async Task GetPackageBytesAsync(string packageName)
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/BasicLoggingTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/BasicLoggingTests.cs
index ed9a58e2782..1f600979ffd 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/BasicLoggingTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/BasicLoggingTests.cs
@@ -3,7 +3,6 @@
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/ListPackageTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/ListPackageTests.cs
index 66aba13d5ab..361a5f60d4c 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/ListPackageTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/ListPackageTests.cs
@@ -29,7 +29,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/TestCommandOutputLogger.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/TestCommandOutputLogger.cs
index a2b9869df51..220761f71fe 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/TestCommandOutputLogger.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/TestCommandOutputLogger.cs
@@ -6,7 +6,7 @@
using NuGet.CommandLine.XPlat;
using NuGet.Common;
using NuGet.Test.Utility;
-using Xunit.Abstractions;
+using Xunit;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatAddPkgTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatAddPkgTests.cs
index 150cbf34bdf..06a96e480e4 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatAddPkgTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatAddPkgTests.cs
@@ -20,7 +20,6 @@
using NuGet.Test.Utility;
using NuGet.Versioning;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatClientCertTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatClientCertTests.cs
index 70a150d4e66..397902a2837 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatClientCertTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatClientCertTests.cs
@@ -14,7 +14,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatConfigTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatConfigTests.cs
index 6f5eb81048f..f6e7095300a 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatConfigTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatConfigTests.cs
@@ -12,7 +12,6 @@
using NuGet.Configuration;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
@@ -37,7 +36,7 @@ public void ConfigPathsCommand_WithDirectoryArg_ListsConfigPaths()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config paths --working-directory {testInfo.WorkingPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, Path.Combine(testInfo.WorkingPath.Path, "NuGet.Config"));
@@ -53,7 +52,7 @@ public void ConfigPathsCommand_WithoutDirectoryArg_ListsConfigPaths()
DotnetCli,
testInfo.WorkingPath,
$"{XplatDll} config paths",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, Path.Combine(testInfo.WorkingPath.Path, "NuGet.Config"));
@@ -70,7 +69,7 @@ public void ConfigPathsCommand_UsingHelpOption_DisplaysHelpMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config paths --help",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, helpMessage);
@@ -86,7 +85,7 @@ public void ConfigGetCommand_WithConfigKeyAndDirectoryArgs_GetsConfigKeyValue()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get http_proxy --working-directory {testInfo.WorkingPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, @"http://company-squid:3128@contoso.test");
@@ -102,7 +101,7 @@ public void ConfigGetCommand_WithConfigKeyAndDirectoryArgsAndShowPathOption_Gets
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get http_proxy --working-directory {testInfo.WorkingPath} --show-path",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, Path.Combine(testInfo.WorkingPath.Path, "NuGet.Config"));
@@ -119,7 +118,7 @@ public void ConfigGetCommand_WithConfigKeyArg_GetsConfigKeyValue()
DotnetCli,
testInfo.WorkingPath,
$"{XplatDll} config get http_proxy",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, @"http://company-squid:3128@contoso.test");
@@ -135,7 +134,7 @@ public void ConfigGetCommand_WithAllAndDirectoryArgs_ShowsAllSettings()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get all --working-directory {Path.Combine(testInfo.WorkingPath, "subfolder")}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, "value=\"https://fontoso.test/v3/index.json\"");
@@ -152,7 +151,7 @@ public void ConfigGetCommand_WithAllAndDirectoryArgsAndShowPathOption_ShowsAllSe
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get all --working-directory {Path.Combine(testInfo.WorkingPath, "subfolder")} --show-path",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, Path.Combine(testInfo.WorkingPath.Path, "NuGet.Config"));
@@ -171,7 +170,7 @@ public void ConfigGetCommand_WithAllArg_ShowsAllSettings()
DotnetCli,
Path.Combine(testInfo.WorkingPath, "subfolder"),
$"{XplatDll} config get all",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, "value=\"https://fontoso.test/v3/index.json\"");
@@ -188,7 +187,7 @@ public void ConfigGetCommand_WithAllArg_ShowsSettingsInPriorityOrder()
DotnetCli,
Path.Combine(testInfo.WorkingPath, "subfolder"),
$"{XplatDll} config get all",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var firstString = "add key=\"Bar\" value=\"https://bontoso.test/v3/index.json\"";
var secondString = "add key=\"Foo\" value=\"https://fontoso.test/v3/index.json\"";
var firstStringIndex = result.Output.IndexOf(firstString);
@@ -209,7 +208,7 @@ public void ConfigGetCommand_WithAllArgAndShowPathOption_ShowsPathsInPriorityOrd
DotnetCli,
workingDirectory,
$"{XplatDll} config get all --show-path",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var firstPath = Path.Combine(workingDirectory, "NuGet.Config");
var secondPath = Path.Combine(testInfo.WorkingPath, "NuGet.Config");
var firstPathIndex = result.Output.IndexOf(firstPath);
@@ -230,7 +229,7 @@ public void ConfigGetCommand_UsingHelpOption_DisplaysHelpMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get --help",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, helpMessage);
@@ -247,7 +246,7 @@ public void ConfigGetCommand_UsingAllArgAndHelpOption_DisplaysHelpMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get all --help",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, helpMessage);
@@ -264,7 +263,7 @@ public void ConfigGetCommand_UsingConfigKeyArgAndHelpOption_DisplaysHelpMessage(
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get http_proxy --help",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, helpMessage);
@@ -284,7 +283,7 @@ public void ConfigSetCommand_WithConfigFileArg_AddsSetting(string key, string va
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config set {key} {value} --configfile {filePath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
ISettings settings = Configuration.Settings.LoadDefaultSettings(
testInfo.WorkingPath,
@@ -322,7 +321,7 @@ public void ConfigSetCommand_WithConfigFileArg_UpdatesSetting()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config set {key} {value} --configfile {filePath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var updatedSettings = Configuration.Settings.LoadDefaultSettings(
testInfo.WorkingPath,
@@ -355,7 +354,7 @@ public void ConfigSetCommand_WithNonExistingConfigSection_AddsConfigSetting()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config set {key} {value} --configfile {filePath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var updatedSettings = Configuration.Settings.LoadSpecificSettings(testInfo.WorkingPath, filePath);
var updatedConfigSection = updatedSettings.GetSection("config");
@@ -383,7 +382,7 @@ public void ConfigSetCommand_UsingHelpOption_DisplaysHelpMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config set --help",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, helpMessage);
@@ -401,7 +400,7 @@ public void ConfigUnsetCommand_WithConfigFileOption_DeletesConfigSettingInSpecif
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config unset {key} --configfile {filePath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var settings = Settings.LoadSpecificSettings(testInfo.WorkingPath, filePath);
var configSection = settings.GetSection("config");
@@ -422,7 +421,7 @@ public void ConfigUnsetCommand_WithNonExistingConfigKey_DisplaysKeyNotFoundMessa
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config unset {key} --configfile {filePath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var expectedMessage = string.Format(CultureInfo.CurrentCulture, Strings.ConfigUnsetNonExistingKey, key);
// Assert
@@ -440,7 +439,7 @@ public void ConfigUnsetCommand_UsingHelpOption_DisplaysHelpMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config unset --help",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, helpMessage);
@@ -457,7 +456,7 @@ public void ConfigCommand_UsingHelpOption_DisplaysHelpMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config --help",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, helpMessage);
@@ -474,7 +473,7 @@ public void ConfigPathsCommand_WithNonExistingDirectoryArg_ThrowsCommandExceptio
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config paths --working-directory {nonExistingDirectory}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var expectedError = string.Format(CultureInfo.CurrentCulture, Strings.Error_PathNotFound, nonExistingDirectory);
// Assert
@@ -492,7 +491,7 @@ public void ConfigGetCommand_WithNonExistingDirectoryArg_ThrowsCommandException(
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get all --working-directory {nonExistingDirectory}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var expectedError = string.Format(CultureInfo.CurrentCulture, Strings.Error_PathNotFound, nonExistingDirectory);
// Assert
@@ -510,7 +509,7 @@ public void ConfigGetCommand_WithInvalidConfigKeyArg_OutputsErrorMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get {invalidKey} --working-directory {testInfo.WorkingPath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var expectedError = string.Format(CultureInfo.CurrentCulture, Strings.ConfigCommandKeyNotFound, invalidKey);
// Assert
@@ -527,7 +526,7 @@ public void ConfigGetCommand_WithoutConfigKeyArg_OutputsErrorMessage()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config get",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var expectedError = "Required argument missing";
// Assert
@@ -547,7 +546,7 @@ public void ConfigSetCommand_WithInvalidConfigKey_ThrowsCommandException()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config set {key} {value} --configfile {filePath}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var expectedError = string.Format(CultureInfo.CurrentCulture, Strings.Error_ConfigSetInvalidKey, key);
// Assert
@@ -565,7 +564,7 @@ public void ConfigUnsetCommand_WithInvalidConfigKeyArg_ThrowsCommandException()
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} config unset {key}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
var expectedError = string.Format(CultureInfo.CurrentCulture, Strings.Error_ConfigSetInvalidKey, key);
// Assert
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatHelpOutputTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatHelpOutputTests.cs
index 330ae18ee4a..c6e23c38d4d 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatHelpOutputTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatHelpOutputTests.cs
@@ -9,7 +9,6 @@
using NuGet.CommandLine.XPlat;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatLocalsTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatLocalsTests.cs
index 6f837e2c83d..d3bb4d73d4c 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatLocalsTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatLocalsTests.cs
@@ -9,7 +9,6 @@
using NuGet.Common;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
@@ -75,7 +74,7 @@ public void Locals_List_Succeeds(string args)
{ "NUGET_PLUGINS_CACHE_PATH", mockPluginsCacheDirectory.FullName },
{ RuntimeEnvironmentHelper.IsWindows ? "TMP" : "TMPDIR", mockTmpCacheDirectory.FullName }
},
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Unix uses TMPDIR as environment variable as opposed to TMP on windows
// Assert
@@ -136,7 +135,7 @@ public void Locals_Clear_Succeeds(string args)
{ RuntimeEnvironmentHelper.IsWindows ? "TMP" : "TMPDIR", mockTmpDirectory.FullName },
{ "NUGET_PLUGINS_CACHE_PATH", mockPluginsCacheDirectory.FullName }
},
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Unix uses TMPDIR as environment variable as opposed to TMP on windows
// Assert
@@ -230,7 +229,7 @@ public void Locals_Success_InvalidArguments_HelpMessage(string args)
DotnetCli,
Path.GetDirectoryName(XplatDll),
$"{XplatDll} {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultFailure(result, expectedResult);
@@ -254,7 +253,7 @@ public void Locals_Success_InvalidResourceName_HelpMessage(string args)
DotnetCli,
Path.GetDirectoryName(XplatDll),
$"{XplatDll} {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultFailure(result, expectedResult);
@@ -278,7 +277,7 @@ public void Locals_Success_InvalidFlags_HelpMessage(string args)
DotnetCli,
Path.GetDirectoryName(XplatDll),
$"{XplatDll} {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultFailure(result, expectedResult);
@@ -303,7 +302,7 @@ public void Locals_Success_NoFlags_HelpMessage(string args)
DotnetCli,
Path.GetDirectoryName(XplatDll),
$"{XplatDll} {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultFailure(result, expectedResult);
@@ -334,7 +333,7 @@ public void Locals_Success_BothFlags_HelpMessage(string args)
DotnetCli,
Path.GetDirectoryName(XplatDll),
$"{XplatDll} {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultFailure(result, expectedResult);
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatPushTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatPushTests.cs
index d714fba68b1..9c1a00cfbec 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatPushTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatPushTests.cs
@@ -8,7 +8,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatTrustTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatTrustTests.cs
index bb3ec3f7d9b..70a51f1d731 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatTrustTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatTrustTests.cs
@@ -10,7 +10,6 @@
using NuGet.Common;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
@@ -40,7 +39,7 @@ public void Trust_UnrecognizedOption_Fails(string unrecognizedOption)
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} trust {unrecognizedOption}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, result.ExitCode);
@@ -65,7 +64,7 @@ public void Trust_RecognizedOption_MissingValue_WrongCombination_Fails(string un
DotnetCli,
Directory.GetCurrentDirectory(),
$"{XplatDll} trust {unrecognizedOption}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
Assert.Equal(1, result.ExitCode);
@@ -91,7 +90,7 @@ public void Trust_List_Empty_Succeeds(string args)
DotnetCli,
mockPackagesDirectory.FullName,
$"{XplatDll} {args}",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
// Assert
DotnetCliUtil.VerifyResultSuccess(result, "There are no trusted signers.");
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatVerifyTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatVerifyTests.cs
index 4fc0452cb29..054e27cd004 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatVerifyTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatVerifyTests.cs
@@ -10,7 +10,6 @@
using NuGet.Commands;
using NuGet.Common;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatWhyTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatWhyTests.cs
index 033d0b51618..2ebe9aebe78 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatWhyTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XPlatWhyTests.cs
@@ -11,7 +11,6 @@
using NuGet.Test.Utility;
using Spectre.Console.Testing;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatRemovePkgTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatRemovePkgTests.cs
index a17310dd1cf..391b69d4c4f 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatRemovePkgTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatRemovePkgTests.cs
@@ -13,7 +13,6 @@
using NuGet.Packaging;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatSignTests.cs b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatSignTests.cs
index 3d4de290f2c..8fc4d7c2412 100644
--- a/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatSignTests.cs
+++ b/test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/XplatSignTests.cs
@@ -15,7 +15,6 @@
using NuGet.Common;
using NuGet.Packaging.Signing;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.XPlat.FuncTest
{
diff --git a/test/NuGet.Core.Tests/Microsoft.Build.NuGetSdkResolver.Test/NuGetSdkResolver_Tests.cs b/test/NuGet.Core.Tests/Microsoft.Build.NuGetSdkResolver.Test/NuGetSdkResolver_Tests.cs
index 9beab0fd655..d501ca6074e 100644
--- a/test/NuGet.Core.Tests/Microsoft.Build.NuGetSdkResolver.Test/NuGetSdkResolver_Tests.cs
+++ b/test/NuGet.Core.Tests/Microsoft.Build.NuGetSdkResolver.Test/NuGetSdkResolver_Tests.cs
@@ -102,29 +102,6 @@ public async Task Resolve_WhenPackageExists_ReturnsSucceededSdkResult()
result.Version.Should().Be(sdkReference.Version);
result.Errors.Should().BeEmpty();
result.Warnings.Should().BeEmpty();
-
- bool wasMessageFound = false;
-
- foreach ((string Message, MessageImportance _) in sdkResolverContext.MockSdkLogger.LoggedMessages)
- {
- // On Linux and macOS the message will be:
- //
- // X.509 certificate chain validation will not have any trusted roots.
- // Chain building will fail with an untrusted status.
- //
- // This is because this test is not a .NET SDK test but a unit test.
- if (Message.Contains("X.509 certificate chain validation will"))
- {
- wasMessageFound = true;
- break;
- }
- }
-
-#if NETFRAMEWORK
- wasMessageFound.Should().BeFalse();
-#else
- wasMessageFound.Should().BeTrue();
-#endif
}
}
diff --git a/test/NuGet.Core.Tests/NuGet.CommandLine.Xplat.Tests/Commands/Package/Update/PackageUpdateCommandRunnerTests/GetPackageToUpdateTests.cs b/test/NuGet.Core.Tests/NuGet.CommandLine.Xplat.Tests/Commands/Package/Update/PackageUpdateCommandRunnerTests/GetPackageToUpdateTests.cs
index 49c0381b085..1d395c41aa9 100644
--- a/test/NuGet.Core.Tests/NuGet.CommandLine.Xplat.Tests/Commands/Package/Update/PackageUpdateCommandRunnerTests/GetPackageToUpdateTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.CommandLine.Xplat.Tests/Commands/Package/Update/PackageUpdateCommandRunnerTests/GetPackageToUpdateTests.cs
@@ -16,7 +16,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.CommandLine.Xplat.Tests.Commands.Package.Update.PackageUpdateCommandRunnerTests;
diff --git a/test/NuGet.Core.Tests/NuGet.Commands.Test/RestoreCommandTests/ProjectRestoreCommandTests.cs b/test/NuGet.Core.Tests/NuGet.Commands.Test/RestoreCommandTests/ProjectRestoreCommandTests.cs
index 3d3e3d4b947..7bcff3f31cb 100644
--- a/test/NuGet.Core.Tests/NuGet.Commands.Test/RestoreCommandTests/ProjectRestoreCommandTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.Commands.Test/RestoreCommandTests/ProjectRestoreCommandTests.cs
@@ -15,7 +15,6 @@
using NuGet.Test.Utility;
using Test.Utility.Commands;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Commands.Test.RestoreCommandTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/BatchedEventTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/BatchedEventTests.cs
index cf83bc41176..e15f98ee9a6 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/BatchedEventTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/BatchedEventTests.cs
@@ -18,7 +18,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.Test.NuGetPackageManagerTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/InstallPackageTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/InstallPackageTests.cs
index f43e4568d41..538541a0ae8 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/InstallPackageTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/InstallPackageTests.cs
@@ -26,7 +26,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.Test.NuGetPackageManagerTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/NuGetPackageManagerTelemetryTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/NuGetPackageManagerTelemetryTests.cs
index 4ec5bb61b3c..77d9290d93d 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/NuGetPackageManagerTelemetryTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/NuGetPackageManagerTelemetryTests.cs
@@ -29,7 +29,6 @@
using NuGet.VisualStudio.Telemetry;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.Test.NuGetPackageManagerTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/OtherTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/OtherTests.cs
index 1a4d0e39c04..e5f11ce9b0a 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/OtherTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/OtherTests.cs
@@ -23,7 +23,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.Test.NuGetPackageManagerTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PackageSourceMappingTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PackageSourceMappingTests.cs
index d24aa0a95b4..5c29de54b65 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PackageSourceMappingTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PackageSourceMappingTests.cs
@@ -22,7 +22,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.Test.NuGetPackageManagerTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PreviewInstallTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PreviewInstallTests.cs
index fc1ca724e3d..1a3882099aa 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PreviewInstallTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/PreviewInstallTests.cs
@@ -26,7 +26,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.Test.NuGetPackageManagerTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/UninstallPackageTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/UninstallPackageTests.cs
index 4ca9d413cb2..4612cd33974 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/UninstallPackageTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGetPackageManagerTests/UninstallPackageTests.cs
@@ -15,7 +15,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.PackageManagement.Test.NuGetPackageManagerTests
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/PackageRestoreManagerTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/PackageRestoreManagerTests.cs
index 4c2e1ecad58..912e74d085f 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/PackageRestoreManagerTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/PackageRestoreManagerTests.cs
@@ -18,7 +18,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Test
{
diff --git a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/V2V3ParityTests.cs b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/V2V3ParityTests.cs
index 08d01019fd6..aaa34b1cd51 100644
--- a/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/V2V3ParityTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.PackageManagement.Test/V2V3ParityTests.cs
@@ -18,7 +18,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Test
{
diff --git a/test/NuGet.Core.Tests/NuGet.Packaging.Test/ExceptionAssert.cs b/test/NuGet.Core.Tests/NuGet.Packaging.Test/ExceptionAssert.cs
index 9935d55f87d..c609b75f1c9 100644
--- a/test/NuGet.Core.Tests/NuGet.Packaging.Test/ExceptionAssert.cs
+++ b/test/NuGet.Core.Tests/NuGet.Packaging.Test/ExceptionAssert.cs
@@ -15,7 +15,7 @@ public static void Throws(Action act) where TException : Exception
public static void Throws(Action act, Action condition) where TException : Exception
{
- Exception ex = Record.Exception(act);
+ Exception? ex = Record.Exception(act);
Assert.NotNull(ex);
TException tex = Assert.IsAssignableFrom(ex);
condition(tex);
diff --git a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpSource/HttpRetryHandlerTests.cs b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpSource/HttpRetryHandlerTests.cs
index b378f92a134..c1d9d1be3a2 100644
--- a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpSource/HttpRetryHandlerTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpSource/HttpRetryHandlerTests.cs
@@ -18,7 +18,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Protocol.Tests
{
diff --git a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Plugins/PluginDiscovererTests.cs b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Plugins/PluginDiscovererTests.cs
index b8414a681cd..91cadff6a73 100644
--- a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Plugins/PluginDiscovererTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Plugins/PluginDiscovererTests.cs
@@ -16,7 +16,6 @@
using NuGet.Common;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Protocol.Plugins.Tests
{
@@ -690,7 +689,7 @@ private void SetFileExecutable(string filePath, bool executable)
CommandRunnerResult result = CommandRunner.Run(
filename: "/bin/bash",
arguments: $"-c \"chmod {(executable ? "+x" : "-x")} '{filePath}'\"",
- testOutputHelper: _testOutputHelper);
+ logLine: _testOutputHelper.WriteLine);
if (!result.Success)
{
diff --git a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/UserAgentStringBuilderTests.cs b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/UserAgentStringBuilderTests.cs
index ac1f888b68e..547df29a84b 100644
--- a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/UserAgentStringBuilderTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/UserAgentStringBuilderTests.cs
@@ -7,7 +7,6 @@
using NuGet.Protocol.Core.Types;
using Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Protocol.Tests
{
diff --git a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Utility/HttpHeaderUtilityTests.cs b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Utility/HttpHeaderUtilityTests.cs
index 807e368e119..cd571cebc63 100644
--- a/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Utility/HttpHeaderUtilityTests.cs
+++ b/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Utility/HttpHeaderUtilityTests.cs
@@ -6,7 +6,6 @@
using System.Net.Http;
using NuGet.Test.Utility;
using Xunit;
-using Xunit.Abstractions;
namespace NuGet.Protocol.Tests.Utility
{
diff --git a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/CommandRunner.cs b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/CommandRunner.cs
index d6a9c7a29d5..36842879c85 100644
--- a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/CommandRunner.cs
+++ b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/CommandRunner.cs
@@ -8,7 +8,6 @@
using System.Diagnostics;
using System.IO;
using System.Text;
-using Xunit.Abstractions;
namespace Microsoft.Internal.NuGet.Testing.SignedPackages.ChildProcess
{
@@ -26,10 +25,10 @@ public class CommandRunner
/// Optional amount of milliseconds to wait for the executable to exit before returning.
/// An optional to invoke against the executables input stream.
/// An optional containing environment variables to specify when running the executable.
- /// An optional to write output to.
+ /// An optional action to write output to.
/// An optional number of times to retry running the command if it times out. Defaults to 1.
/// A containing details about the result of the running the executable including the exit code and console output.
- public static CommandRunnerResult Run(string filename, string workingDirectory = null, string arguments = null, int timeOutInMilliseconds = 60000, Action inputAction = null, IReadOnlyDictionary environmentVariables = null, ITestOutputHelper testOutputHelper = null, int timeoutRetryCount = 1)
+ public static CommandRunnerResult Run(string filename, string workingDirectory = null, string arguments = null, int timeOutInMilliseconds = 60000, Action inputAction = null, IReadOnlyDictionary environmentVariables = null, Action logLine = null, int timeoutRetryCount = 1)
{
if (workingDirectory is null)
{
@@ -81,7 +80,7 @@ public static CommandRunnerResult Run(string filename, string workingDirectory =
process.OutputDataReceived += OnOutputDataReceived;
process.ErrorDataReceived += OnErrorDataReceived;
- testOutputHelper?.WriteLine($"> {process.StartInfo.FileName} {process.StartInfo.Arguments}");
+ logLine?.Invoke($"> {process.StartInfo.FileName} {process.StartInfo.Arguments}");
Stopwatch stopwatch = Stopwatch.StartNew();
@@ -101,6 +100,12 @@ public static CommandRunnerResult Run(string filename, string workingDirectory =
process.Kill();
}
+ // Unsubscribe event handlers and flush async output before throwing,
+ // to prevent callbacks from firing after the test has completed.
+ process.OutputDataReceived -= OnOutputDataReceived;
+ process.ErrorDataReceived -= OnErrorDataReceived;
+ process.WaitForExit();
+
throw new TimeoutException($"{process.StartInfo.FileName} {process.StartInfo.Arguments} timed out after {stopwatch.Elapsed.TotalSeconds:N2} seconds");
}
@@ -108,12 +113,12 @@ public static CommandRunnerResult Run(string filename, string workingDirectory =
process.WaitForExit();
stopwatch.Stop();
- testOutputHelper?.WriteLine($"└ Completed in {stopwatch.Elapsed.TotalSeconds:N2}s");
+ logLine?.Invoke($"└ Completed in {stopwatch.Elapsed.TotalSeconds:N2}s");
process.OutputDataReceived -= OnOutputDataReceived;
process.ErrorDataReceived -= OnErrorDataReceived;
- testOutputHelper?.WriteLine(string.Empty);
+ logLine?.Invoke(string.Empty);
exitCode = process.ExitCode;
}
@@ -123,7 +128,7 @@ void OnOutputDataReceived(object sender, DataReceivedEventArgs args)
{
if (args?.Data != null)
{
- testOutputHelper?.WriteLine($"│ {args.Data}");
+ logLine?.Invoke($"│ {args.Data}");
lock (output)
{
@@ -136,7 +141,7 @@ void OnErrorDataReceived(object sender, DataReceivedEventArgs args)
{
if (args?.Data != null)
{
- testOutputHelper?.WriteLine($"│ {args.Data}");
+ logLine?.Invoke($"│ {args.Data}");
lock (error)
{
@@ -146,7 +151,7 @@ void OnErrorDataReceived(object sender, DataReceivedEventArgs args)
}
},
timeoutRetryCount,
- testOutputHelper);
+ logLine);
}
}
}
diff --git a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/RetryRunner.cs b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/RetryRunner.cs
index 2d48acfb8d2..fb138f97018 100644
--- a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/RetryRunner.cs
+++ b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/ChildProcess/RetryRunner.cs
@@ -6,13 +6,12 @@
#pragma warning disable CS1591
using System;
-using Xunit.Abstractions;
namespace Microsoft.Internal.NuGet.Testing.SignedPackages.ChildProcess
{
public class RetryRunner
{
- public static T RunWithRetries(Func func, int maxRetries = 1, ITestOutputHelper logger = null) where E : Exception
+ public static T RunWithRetries(Func func, int maxRetries = 1, Action logLine = null) where E : Exception
{
{
int retryCount = 0;
@@ -31,8 +30,8 @@ public static T RunWithRetries(Func func, int maxRetries = 1, ITestOutp
}
retryCount++;
- logger?.WriteLine($"Encountered exception during run attempt #{retryCount}: {exception.Message}");
- logger?.WriteLine($"Retrying {retryCount} of {maxRetries}");
+ logLine?.Invoke($"Encountered exception during run attempt #{retryCount}: {exception.Message}");
+ logLine?.Invoke($"Retrying {retryCount} of {maxRetries}");
}
}
}
diff --git a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/Microsoft.Internal.NuGet.Testing.SignedPackages.csproj b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/Microsoft.Internal.NuGet.Testing.SignedPackages.csproj
index 4cd4e66871e..8b77d11c606 100644
--- a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/Microsoft.Internal.NuGet.Testing.SignedPackages.csproj
+++ b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/Microsoft.Internal.NuGet.Testing.SignedPackages.csproj
@@ -22,10 +22,6 @@
-
-
-
-
diff --git a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SignatureTestUtility.cs b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SignatureTestUtility.cs
index 548d7a1690f..b984c09082c 100644
--- a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SignatureTestUtility.cs
+++ b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SignatureTestUtility.cs
@@ -11,7 +11,6 @@
using System.Threading.Tasks;
using NuGet.Common;
using NuGet.Packaging.Signing;
-using Xunit;
namespace Microsoft.Internal.NuGet.Testing.SignedPackages
{
@@ -43,8 +42,7 @@ public static Task WaitForCertificateExpirationAsync(X509Certificate2 certificat
return Task.Delay(delay);
}
- Assert.True(DateTimeOffset.Now > notAfter);
-
+ // The certificate has already expired, which is the desired state.
return Task.CompletedTask;
}
diff --git a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SigningTestUtility.cs b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SigningTestUtility.cs
index 189180f6141..b35f0957b91 100644
--- a/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SigningTestUtility.cs
+++ b/test/TestUtilities/Microsoft.Internal.NuGet.Testing.SignedPackages/SigningTestUtility.cs
@@ -18,7 +18,6 @@
using NuGet.Common;
using NuGet.Packaging.Core;
using NuGet.Packaging.Signing;
-using Xunit;
namespace Microsoft.Internal.NuGet.Testing.SignedPackages
{
@@ -780,7 +779,10 @@ public static void VerifySerialNumber(BigInteger serialNumber1, byte[] serialNum
public static void VerifyByteSequences(ReadOnlyMemory expected, ReadOnlyMemory actual)
{
- Assert.Equal(expected.Length, actual.Length);
+ if (expected.Length != actual.Length)
+ {
+ throw new InvalidOperationException($"Expected length is {expected.Length}, but actual length is {actual.Length}");
+ }
VerifyByteArrays(expected.Span.ToArray(), actual.Span.ToArray());
}
@@ -790,7 +792,10 @@ public static void VerifyByteArrays(byte[] expected, byte[] actual)
var expectedHex = BitConverter.ToString(expected).Replace("-", "");
var actualHex = BitConverter.ToString(actual).Replace("-", "");
- Assert.Equal(expectedHex, actualHex);
+ if (!expectedHex.Equals(actualHex))
+ {
+ throw new InvalidOperationException(message: $"Expected byte array is {expectedHex}, but actual byte array is {actualHex}");
+ }
}
//We will not change the original X509ChainStatus.StatusInformation of OfflineRevocation if we directly call API CertificateChainUtility.GetCertificateChain (or SigningUtility.Verify)
@@ -804,7 +809,10 @@ public static void AssertOfflineRevocation(IEnumerable issues, LogL
issue.Level == logLevel &&
issue.Message.Split(new[] { ' ', ':' }).Any(WORDEXTFLAGS => WORDEXTFLAGS == offlineRevocation));
- Assert.True(isOfflineRevocation);
+ if (!isOfflineRevocation)
+ {
+ throw new InvalidOperationException("Expected OfflineRevocation issue was not found.");
+ }
}
//We will change the original X509ChainStatus.StatusInformation of OfflineRevocation to VerifyCertTrustOfflineWhileRevocationModeOffline or VerifyCertTrustOfflineWhileRevocationModeOnline in Signature.cs and Timestamp.cs
@@ -816,10 +824,13 @@ public static void AssertOfflineRevocationOnlineMode(IEnumerable i
public static void AssertOfflineRevocationOnlineMode(IEnumerable issues, LogLevel logLevel, NuGetLogCode code)
{
- Assert.Contains(issues, issue =>
+ if (!issues.Any(issue =>
issue.Code == code &&
issue.Level == logLevel &&
- issue.Message.Contains(global::NuGet.Packaging.Strings.VerifyCertTrustOfflineWhileRevocationModeOnline));
+ issue.Message.Contains(global::NuGet.Packaging.Strings.VerifyCertTrustOfflineWhileRevocationModeOnline)))
+ {
+ throw new InvalidOperationException("Expected OfflineRevocationOnlineMode issue was not found.");
+ }
}
public static void AssertOfflineRevocationOfflineMode(IEnumerable issues)
@@ -829,10 +840,13 @@ public static void AssertOfflineRevocationOfflineMode(IEnumerable
public static void AssertOfflineRevocationOfflineMode(IEnumerable issues, LogLevel logLevel, NuGetLogCode code)
{
- Assert.Contains(issues, issue =>
+ if (!issues.Any(issue =>
issue.Code == code &&
issue.Level == logLevel &&
- issue.Message.Contains(global::NuGet.Packaging.Strings.VerifyCertTrustOfflineWhileRevocationModeOffline));
+ issue.Message.Contains(global::NuGet.Packaging.Strings.VerifyCertTrustOfflineWhileRevocationModeOffline)))
+ {
+ throw new InvalidOperationException("Expected OfflineRevocationOfflineMode issue was not found.");
+ }
}
public static void AssertRevocationStatusUnknown(IEnumerable issues, LogLevel logLevel)
@@ -849,7 +863,10 @@ public static void AssertRevocationStatusUnknown(IEnumerable issues
issue.Level == logLevel &&
issue.Message.Split(new[] { ' ', ':' }).Any(WORDEXTFLAGS => WORDEXTFLAGS == revocationStatusUnknown));
- Assert.True(isRevocationStatusUnknown);
+ if (!isRevocationStatusUnknown)
+ {
+ throw new InvalidOperationException("Expected RevocationStatusUnknown issue was not found.");
+ }
}
public static void AssertUntrustedRoot(IEnumerable issues, NuGetLogCode code, LogLevel logLevel)
@@ -862,14 +879,20 @@ public static void AssertUntrustedRoot(IEnumerable issues, NuGetLog
(issue.Message.Contains("certificate is not trusted by the trust provider") ||
issue.Message.Split(new[] { ' ', ':' }).Any(WORDEXTFLAGS => WORDEXTFLAGS == untrustedRoot)));
- Assert.True(isUntrustedRoot);
+ if (!isUntrustedRoot)
+ {
+ throw new InvalidOperationException("Expected UntrustedRoot issue was not found.");
+ }
#if NET5_0_OR_GREATER
if (!RuntimeEnvironmentHelper.IsWindows)
{
bool hasNU3042 = issues.Any(issue => issue.Code == NuGetLogCode.NU3042);
- Assert.True(hasNU3042);
+ if (!hasNU3042)
+ {
+ throw new InvalidOperationException("Expected NU3042 issue was not found.");
+ }
}
#endif
}
@@ -888,7 +911,10 @@ public static void AssertNotTimeValid(IEnumerable issues, LogLevel
issue.Level == logLevel &&
issue.Message.Split(new[] { ' ', ':' }).Any(WORDEXTFLAGS => WORDEXTFLAGS == notTimeValid));
- Assert.True(isNotTimeValid);
+ if (!isNotTimeValid)
+ {
+ throw new InvalidOperationException("Expected NotTimeValid issue was not found.");
+ }
}
public static string AddSignatureLogPrefix(string log, PackageIdentity package, string source)
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyFactAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyFactAttribute.cs
index 0f597578e53..c205dc094f2 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyFactAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyFactAttribute.cs
@@ -13,29 +13,11 @@ namespace NuGet.Test.Utility
public class CIOnlyFactAttribute
: FactAttribute
{
- private string _skip;
-
- public override string Skip
+ public CIOnlyFactAttribute()
{
- get
- {
- var skip = _skip;
-
- if (string.IsNullOrEmpty(skip))
- {
- if (!XunitAttributeUtility.IsCI)
- {
- skip = "This test only runs on the CI. To run it locally set the env var CI=true";
- }
- }
-
- // If this is null the test will run.
- return skip;
- }
-
- set
+ if (!XunitAttributeUtility.IsCI)
{
- _skip = value;
+ Skip = "This test only runs on the CI. To run it locally set the env var CI=true";
}
}
}
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyTheoryAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyTheoryAttribute.cs
index 5e9a02a1644..0c06163996d 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyTheoryAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/CIOnlyTheoryAttribute.cs
@@ -13,29 +13,11 @@ namespace NuGet.Test.Utility
public class CIOnlyTheoryAttribute
: TheoryAttribute
{
- private string _skip;
-
- public override string Skip
+ public CIOnlyTheoryAttribute()
{
- get
- {
- var skip = _skip;
-
- if (string.IsNullOrEmpty(skip))
- {
- if (!XunitAttributeUtility.IsCI)
- {
- skip = "This test only runs on the CI. To run it locally set the env var CI=true";
- }
- }
-
- // If this is null the test will run.
- return skip;
- }
-
- set
+ if (!XunitAttributeUtility.IsCI)
{
- _skip = value;
+ Skip = "This test only runs on the CI. To run it locally set the env var CI=true";
}
}
}
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsFactAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsFactAttribute.cs
index 30d1485a08f..f044b4f6b8a 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsFactAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsFactAttribute.cs
@@ -14,37 +14,30 @@ namespace NuGet.Test.Utility
public class FileExistsFactAttribute
: FactAttribute
{
- private string _skip;
+ private IEnumerable _paths = new List();
+ private string _path;
+ private bool _allowCIToSkip;
- public override string Skip
+ public IEnumerable Paths
{
- get
- {
- var skip = _skip;
-
- if (string.IsNullOrEmpty(skip))
- {
- skip = XunitAttributeUtility.GetFileExistsSkipMessageOrNull(AllowCIToSkip, GetPaths());
- }
-
- // If this is null the test will run.
- return skip;
- }
-
- set
- {
- _skip = value;
- }
+ get => _paths;
+ set { _paths = value; EvaluateSkip(); }
}
- public IEnumerable Paths { get; set; } = new List();
-
- public string Path { get; set; }
+ public string Path
+ {
+ get => _path;
+ set { _path = value; EvaluateSkip(); }
+ }
///
/// If true the CI will be allowed to skip this test.
///
- public bool AllowCIToSkip { get; set; }
+ public bool AllowCIToSkip
+ {
+ get => _allowCIToSkip;
+ set { _allowCIToSkip = value; EvaluateSkip(); }
+ }
public FileExistsFactAttribute()
{
@@ -52,14 +45,20 @@ public FileExistsFactAttribute()
public FileExistsFactAttribute(params string[] paths)
{
- Paths = paths.ToList();
+ _paths = paths.ToList();
+ EvaluateSkip();
+ }
+
+ private void EvaluateSkip()
+ {
+ Skip = XunitAttributeUtility.GetFileExistsSkipMessageOrNull(_allowCIToSkip, GetPaths());
}
private string[] GetPaths()
{
- var paths = new HashSet(Paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
+ var paths = new HashSet(_paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
{
- Path
+ _path
};
return paths.Where(e => !string.IsNullOrEmpty(e)).ToArray();
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingFactAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingFactAttribute.cs
index 50172425ea5..4e0b569ccc4 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingFactAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingFactAttribute.cs
@@ -15,39 +15,30 @@ namespace NuGet.Test.Utility
public class FileExistsInNuGetRoamingFactAttribute
: FactAttribute
{
- private string _skip;
+ private IEnumerable _paths = new List();
+ private string _path;
+ private bool _allowCIToSkip;
- public override string Skip
+ public IEnumerable Paths
{
- get
- {
- var skip = _skip;
-
- if (string.IsNullOrEmpty(skip))
- {
- var dir = NuGetEnvironment.GetFolderPath(NuGetFolderPath.UserSettingsDirectory);
-
- skip = XunitAttributeUtility.GetFileExistsInDirSkipMessageOrNull(AllowCIToSkip, dir, GetPaths());
- }
-
- // If this is null the test will run.
- return skip;
- }
-
- set
- {
- _skip = value;
- }
+ get => _paths;
+ set { _paths = value; EvaluateSkip(); }
}
- public IEnumerable Paths { get; set; } = new List();
-
- public string Path { get; set; }
+ public string Path
+ {
+ get => _path;
+ set { _path = value; EvaluateSkip(); }
+ }
///
/// If true the CI will be allowed to skip this test.
///
- public bool AllowCIToSkip { get; set; }
+ public bool AllowCIToSkip
+ {
+ get => _allowCIToSkip;
+ set { _allowCIToSkip = value; EvaluateSkip(); }
+ }
public FileExistsInNuGetRoamingFactAttribute()
{
@@ -55,14 +46,21 @@ public FileExistsInNuGetRoamingFactAttribute()
public FileExistsInNuGetRoamingFactAttribute(params string[] paths)
{
- Paths = paths.ToList();
+ _paths = paths.ToList();
+ EvaluateSkip();
+ }
+
+ private void EvaluateSkip()
+ {
+ var dir = NuGetEnvironment.GetFolderPath(NuGetFolderPath.UserSettingsDirectory);
+ Skip = XunitAttributeUtility.GetFileExistsInDirSkipMessageOrNull(_allowCIToSkip, dir, GetPaths());
}
private string[] GetPaths()
{
- var paths = new HashSet(Paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
+ var paths = new HashSet(_paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
{
- Path
+ _path
};
return paths.Where(e => !string.IsNullOrEmpty(e)).ToArray();
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingTheoryAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingTheoryAttribute.cs
index c02f549a47f..9ddd3e386c1 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingTheoryAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsInNuGetRoamingTheoryAttribute.cs
@@ -15,39 +15,30 @@ namespace NuGet.Test.Utility
public class FileExistsInNuGetRoamingTheoryAttribute
: TheoryAttribute
{
- private string _skip;
+ private IEnumerable _paths = new List();
+ private string _path;
+ private bool _allowCIToSkip;
- public override string Skip
+ public IEnumerable Paths
{
- get
- {
- var skip = _skip;
-
- if (string.IsNullOrEmpty(skip))
- {
- var dir = NuGetEnvironment.GetFolderPath(NuGetFolderPath.UserSettingsDirectory);
-
- skip = XunitAttributeUtility.GetFileExistsInDirSkipMessageOrNull(AllowCIToSkip, dir, GetPaths());
- }
-
- // If this is null the test will run.
- return skip;
- }
-
- set
- {
- _skip = value;
- }
+ get => _paths;
+ set { _paths = value; EvaluateSkip(); }
}
- public IEnumerable Paths { get; set; } = new List();
-
- public string Path { get; set; }
+ public string Path
+ {
+ get => _path;
+ set { _path = value; EvaluateSkip(); }
+ }
///
/// If true the CI will be allowed to skip this test.
///
- public bool AllowCIToSkip { get; set; }
+ public bool AllowCIToSkip
+ {
+ get => _allowCIToSkip;
+ set { _allowCIToSkip = value; EvaluateSkip(); }
+ }
public FileExistsInNuGetRoamingTheoryAttribute()
{
@@ -55,14 +46,21 @@ public FileExistsInNuGetRoamingTheoryAttribute()
public FileExistsInNuGetRoamingTheoryAttribute(params string[] paths)
{
- Paths = paths.ToList();
+ _paths = paths.ToList();
+ EvaluateSkip();
+ }
+
+ private void EvaluateSkip()
+ {
+ var dir = NuGetEnvironment.GetFolderPath(NuGetFolderPath.UserSettingsDirectory);
+ Skip = XunitAttributeUtility.GetFileExistsInDirSkipMessageOrNull(_allowCIToSkip, dir, GetPaths());
}
private string[] GetPaths()
{
- var paths = new HashSet(Paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
+ var paths = new HashSet(_paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
{
- Path
+ _path
};
return paths.Where(e => !string.IsNullOrEmpty(e)).ToArray();
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsTheoryAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsTheoryAttribute.cs
index 859541e32fb..de62e28af6c 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsTheoryAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/FileExistsTheoryAttribute.cs
@@ -14,37 +14,30 @@ namespace NuGet.Test.Utility
public class FileExistsTheoryAttribute
: TheoryAttribute
{
- private string _skip;
+ private IEnumerable _paths = new List();
+ private string _path;
+ private bool _allowCIToSkip;
- public override string Skip
+ public IEnumerable Paths
{
- get
- {
- var skip = _skip;
-
- if (string.IsNullOrEmpty(skip))
- {
- skip = XunitAttributeUtility.GetFileExistsSkipMessageOrNull(AllowCIToSkip, GetPaths());
- }
-
- // If this is null the test will run.
- return skip;
- }
-
- set
- {
- _skip = value;
- }
+ get => _paths;
+ set { _paths = value; EvaluateSkip(); }
}
- public IEnumerable Paths { get; set; } = new List();
-
- public string Path { get; set; }
+ public string Path
+ {
+ get => _path;
+ set { _path = value; EvaluateSkip(); }
+ }
///
/// If true the CI will be allowed to skip this test.
///
- public bool AllowCIToSkip { get; set; }
+ public bool AllowCIToSkip
+ {
+ get => _allowCIToSkip;
+ set { _allowCIToSkip = value; EvaluateSkip(); }
+ }
public FileExistsTheoryAttribute()
{
@@ -52,14 +45,20 @@ public FileExistsTheoryAttribute()
public FileExistsTheoryAttribute(params string[] paths)
{
- Paths = paths.ToList();
+ _paths = paths.ToList();
+ EvaluateSkip();
+ }
+
+ private void EvaluateSkip()
+ {
+ Skip = XunitAttributeUtility.GetFileExistsSkipMessageOrNull(_allowCIToSkip, GetPaths());
}
private string[] GetPaths()
{
- var paths = new HashSet(Paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
+ var paths = new HashSet(_paths ?? Array.Empty(), StringComparer.OrdinalIgnoreCase)
{
- Path
+ _path
};
return paths.Where(e => !string.IsNullOrEmpty(e)).ToArray();
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyFactAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyFactAttribute.cs
index 711f4afd9e5..b600398c11b 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyFactAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyFactAttribute.cs
@@ -12,20 +12,12 @@ namespace NuGet.Test.Utility
public class LocalOnlyFactAttribute
: FactAttribute
{
- public override string Skip
+ public LocalOnlyFactAttribute()
{
- get
+ if (XunitAttributeUtility.IsCI)
{
- if (string.IsNullOrEmpty(base.Skip)
- && XunitAttributeUtility.IsCI)
- {
- base.Skip = "This Fact only run on non-CI machines. To run it, set the env var CI=false";
- }
-
- return base.Skip;
+ Skip = "This Fact only run on non-CI machines. To run it, set the env var CI=false";
}
-
- set => base.Skip = value;
}
}
}
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyTheoryAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyTheoryAttribute.cs
index 13f53e4a7ec..932a2669d8a 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyTheoryAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/LocalOnlyTheoryAttribute.cs
@@ -12,20 +12,12 @@ namespace NuGet.Test.Utility
public class LocalOnlyTheoryAttribute
: TheoryAttribute
{
- public override string Skip
+ public LocalOnlyTheoryAttribute()
{
- get
+ if (XunitAttributeUtility.IsCI)
{
- if (string.IsNullOrEmpty(base.Skip)
- && XunitAttributeUtility.IsCI)
- {
- base.Skip = "This Theory only run on non-CI machines. To run it, set the env var CI=false";
- }
-
- return base.Skip;
+ Skip = "This Theory only run on non-CI machines. To run it, set the env var CI=false";
}
-
- set => base.Skip = value;
}
}
}
diff --git a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/PackageSourceTheoryAttribute.cs b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/PackageSourceTheoryAttribute.cs
index 7ade5450954..51c511dab80 100644
--- a/test/TestUtilities/Test.Utility/PlatformXunitAttributes/PackageSourceTheoryAttribute.cs
+++ b/test/TestUtilities/Test.Utility/PlatformXunitAttributes/PackageSourceTheoryAttribute.cs
@@ -9,59 +9,57 @@
using System.IO;
using System.Linq;
using System.Reflection;
+using System.Threading.Tasks;
using NuGet.Configuration;
using Xunit;
-using Xunit.Abstractions;
using Xunit.Sdk;
+using Xunit.v3;
namespace NuGet.Test.Utility
{
public sealed class PackageSourceTheoryAttribute : TheoryAttribute
{
- private string _skip;
+ private bool _ciOnly;
- public bool CIOnly { get; set; }
+ public bool CIOnly
+ {
+ get => _ciOnly;
+ set { _ciOnly = value; EvaluateSkip(); }
+ }
public string ConfigFile { get; set; } = TestSources.ConfigFile;
public string Root { get; } = TestSources.GetConfigFileRoot();
- public override string Skip
+ public PackageSourceTheoryAttribute()
+ {
+ EvaluateSkip();
+ }
+
+ private void EvaluateSkip()
{
- get
+ if (_ciOnly && !XunitAttributeUtility.IsCI)
{
- var skip = _skip;
+ Skip = "This test only runs on the CI. To run it locally set the env var CI=true";
+ return;
+ }
- if (string.IsNullOrEmpty(skip))
- {
- if (CIOnly && !XunitAttributeUtility.IsCI)
- {
- skip = "This test only runs on the CI. To run it locally set the env var CI=true";
- }
- else
- {
-
- var fullPath = Path.Combine(Root, ConfigFile);
- // Skip if a file does not exist, otherwise run the test.
- if (!File.Exists(fullPath))
- {
- skip = $"Required file does not exist: '{fullPath}'.";
- }
- }
- }
-
- // If this is null the test will run.
- return skip;
+ var fullPath = Path.Combine(Root, ConfigFile);
+ if (!File.Exists(fullPath))
+ {
+ Skip = $"Required file does not exist: '{fullPath}'.";
+ return;
}
- set => _skip = value;
+ Skip = null;
}
}
- [DataDiscoverer("NuGet.Test.Utility.PackageSourceDataDiscoverer", "Test.Utility")]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class PackageSourceDataAttribute : DataAttribute
{
+ private static readonly ConcurrentDictionary _cachedSources = new ConcurrentDictionary();
+
public ISet SourceNames { get; }
public PackageSourceDataAttribute(params string[] sourceNames)
@@ -69,78 +67,62 @@ public PackageSourceDataAttribute(params string[] sourceNames)
SourceNames = new HashSet(sourceNames, StringComparer.OrdinalIgnoreCase);
}
- public override IEnumerable