public void Should_Add_Multiple_Accounts_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat", result.Args); }
public void Should_Find_Tfx_Executable_If_Tool_Path_Not_Provided() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); // When var result = fixture.Run(); // Then Assert.Equal("/Working/tools/tfx.cmd", result.Path.FullPath); }
public void Should_Add_LocRoot_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.LocRoot = "locroot"; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --loc-root \"locroot\"", result.Args); }
public void Should_Add_OutputPath_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.OutputPath = "./buildartifacts"; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --output-path \"/Working/buildartifacts\"", result.Args); }
public void Should_Add_ExtensionId_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.ExtensionId = "cake-build"; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --extension-id \"cake-build\"", result.Args); }
public void Should_Add_BypassValidation_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.BypassValidation = true; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --bypass-validation", result.Args); }
public void Should_Add_OverridesFile_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.OverridesFile = "./override.txt"; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --overrides-file \"/Working/override.txt\"", result.Args); }
public void Should_Add_AuthType_To_Arguments_If_Set(TfxAuthType authType, string expected) { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.AuthType = authType; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Add_Proxy_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.Proxy = "proxy"; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --proxy \"proxy\"", result.Args); }
public void Should_Add_ServiceUrl_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.ServiceUrl = "http://test.com"; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --service-url \"http://test.com\"", result.Args); }
public void Should_Add_UserName_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.UserName = "******"; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --username \"gep13\"", result.Args); }
public void Should_Throw_If_Settings_Are_Null() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings = null; // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <ArgumentNullException>(result); Assert.Equal("publishSettings", ((ArgumentNullException)result).ParamName); }
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.GivenProcessExitsWithCode(1); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <CakeException>(result); Assert.Equal("Tfx: Process returned an error (exit code 1).", result.Message); }
public void Should_Throw_If_Process_Was_Not_Started() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.GivenProcessCannotStart(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <CakeException>(result); Assert.Equal("Tfx: Process was not started.", result.Message); }
public void Should_Use_Tfx_Executable_From_Tool_Path_If_Provided(string toolPath, string expected) { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.ToolPath = toolPath; fixture.GivenSettingsToolPathExist(); // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Path.FullPath); }
public void Should_Throw_If_Tfx_Executable_Was_Not_Found() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.GivenDefaultToolDoNotExist(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsType <CakeException>(result); Assert.Equal("Tfx: Could not locate executable.", result.Message); }
public void Should_Add_Multiple_ShareWith_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.ShareWith = new List <string> { "account1", "account2" }; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --share-with \"account1\" \"account2\" --auth-type pat", result.Args); }
public void Should_Add_Multiple_Manifest_Globs_To_Arguments_If_Set() { // Given var fixture = new TfxExtensionPublishRunnerFixture(); fixture.Settings.ManifestGlobs = new List <string> { "test", "test1" }; // When var result = fixture.Run(); // Then Assert.Equal("extension publish --vsix \"c:/temp/test.vsix\" --auth-type pat --manifest-globs \"test\" \"test1\"", result.Args); }