@Test public void assertArguments() { ServerConfigurationProvider config = mock(ServerConfigurationProvider.class); when(config.getUrl()).thenReturn("https//tfs02.codeplex.com"); when(config.getUserName()).thenReturn("snd\\user_cp"); when(config.getUserPassword()).thenReturn("password"); MaskedArgumentListBuilder arguments = new MapWorkfolderCommand(config, "$/serverPath", "localFolder").getArguments(); assertNotNull("Arguments were null", arguments); assertEquals( "workfold -map $/serverPath localFolder -server:https//tfs02.codeplex.com -login:snd\\user_cp,password", arguments.toStringWithQuote()); }
protected void addLoginArgument(MaskedArgumentListBuilder arguments) { if ((Util.fixEmpty(config.getUserName()) != null) && (config.getUserPassword() != null)) { arguments.addMasked( String.format("-login:%s,%s", config.getUserName(), config.getUserPassword())); } }