public void CallNuGetPackageCommandLineTests_WhenCallingPushMethodShouldFormatPushParametersCorrectly() { var nuGetFilePath = string.Empty; if (!string.IsNullOrWhiteSpace(TestContext.DataRow["NuGetFilePath"].ToString())) { nuGetFilePath = GetNugetFilePath(TestContext.DeploymentDirectory); } var nuGetPushDestination = TestContext.DataRow["NuGetPushDestination"].ToString(); var nuGetPackageLocation = TestContext.DataRow["NuGetOutputPath"].ToString(); var apiKey = TestContext.DataRow["ApiKey"].ToString(); var testNuGetProcess = new TestNuGetProcess(); var pushWithNuGet = new PushWithNuGet { NuGetProcess = testNuGetProcess }; if (string.IsNullOrWhiteSpace(nuGetFilePath)) { nuGetFilePath = "nuget.exe"; } pushWithNuGet.NuGetPublishing(nuGetFilePath, nuGetPackageLocation, nuGetPushDestination, apiKey, null); string expectedResult = string.Format("push \"{0}\" {1} -s \"{2}\"", nuGetPackageLocation, apiKey, nuGetPushDestination); //Assert.AreEqual(nuGetFilePath, testNuGetProcess.NuGetFilePath); Assert.AreEqual(expectedResult, testNuGetProcess.Arguments); }
public void CallNuGetPackageCommandLineTests_WhenCallingPackMethodShouldThrowExceptionWithEmptyNuGetPackageLocation() { var testNuGetProcess = new TestNuGetProcess(); var pushWithNuGet = new PushWithNuGet { NuGetProcess = testNuGetProcess }; pushWithNuGet.NuGetPublishing(NuGetFile, null, NuGetPushDestination, ApiKey, null); }
public void CallNuGetPackageCommandLineTests_WhenCallingPackMethodWithGoodUrlShouldPushWithoutApiKey() { var testNuGetProcess = new TestNuGetProcess(); var pushWithNuGet = new PushWithNuGet() { NuGetProcess = testNuGetProcess }; var result = pushWithNuGet.NuGetPublishing(NuGetFile, NuGetPackageLocation, "https://nuget.org/", "", null); }
public void CallNuGetPackageCommandLineTests_WhenCallingPushMethodShouldFormatPushParametersCorrectly() { var nuGetFilePath = string.Empty; if (!string.IsNullOrWhiteSpace(TestContext.DataRow["NuGetFilePath"].ToString())) { nuGetFilePath = GetNugetFilePath(TestContext.DeploymentDirectory); } var nuGetPushDestination = TestContext.DataRow["NuGetPushDestination"].ToString(); var nuGetPackageLocation = TestContext.DataRow["NuGetOutputPath"].ToString(); var apiKey = TestContext.DataRow["ApiKey"].ToString(); var testNuGetProcess = new TestNuGetProcess(); var pushWithNuGet = new PushWithNuGet {NuGetProcess = testNuGetProcess}; if (string.IsNullOrWhiteSpace(nuGetFilePath)) { nuGetFilePath = "nuget.exe"; } pushWithNuGet.NuGetPublishing(nuGetFilePath, nuGetPackageLocation, nuGetPushDestination, apiKey, null); string expectedResult = string.Format("push \"{0}\" {1} -s \"{2}\"", nuGetPackageLocation, apiKey, nuGetPushDestination); //Assert.AreEqual(nuGetFilePath, testNuGetProcess.NuGetFilePath); Assert.AreEqual(expectedResult, testNuGetProcess.Arguments); }