public void GetLocalVersionCommandLine() { var provider = new VaultVersionControlProvider(@"C:\Program Files\SourceGear\Vault Client\vault.exe"); var args = new VersionControlArguments { Credentials = new NetworkCredential("Username", "Password"), Operation = VersionControlOperation.GetLocalVersion, Project = "ProjectName", Provider = "Vault", Server = "Server:Port", SourcePath = "SourcePath\\FileName.ext" }; var result = provider.BuildCommandLineArguments(args); Assert.AreEqual("listfolder -host \"Server:Port\" -user \"Username\" -password \"Password\" -repository \"ProjectName\" \"$SourcePath\"", result); }
public void BuildCommandLineArguments_for_get_specific_version() { var provider = new VaultVersionControlProvider(@"C:\Program Files\SourceGear\Vault Client\vault.exe"); var args = new VersionControlArguments { Credentials = new NetworkCredential("Username", "Password"), DestinationPath = "DestinationPath", Operation = VersionControlOperation.Get, Project = "ProjectName", Provider = "Vault", Server = "Server:Port", SourcePath = "SourcePath", Version = "50" }; var result = provider.BuildCommandLineArguments(args); Assert.AreEqual("getversion -host \"Server:Port\" -user \"Username\" -password \"Password\" -repository \"ProjectName\" 50 \"$SourcePath\" \"DestinationPath\"", result); }
public void Get_for_label() { var provider = new VaultVersionControlProvider(@"C:\Program Files\SourceGear\Vault Client\vault.exe"); var args = new VersionControlArguments { Credentials = new NetworkCredential("Username", "Password"), DestinationPath = @"C:\DestinationPath\", Operation = VersionControlOperation.Get, Project = "ProjectName", Provider = "Vault", Server = "Server:Port", SourcePath = "/SourcePath/FileName.ext", Label = "My Label" }; var result = provider.BuildCommandLineArguments(args); Assert.AreEqual("getlabel -host \"Server:Port\" -user \"Username\" -password \"Password\" -repository \"ProjectName\" -destpath \"C:\\DestinationPath\" \"$SourcePath/FileName.ext\" \"My Label\"", result); }