public void FromPublishProfile_ValidXml_ReturnsObject() { var profile = BuildPublishProfile(); string server = "https://super-cool-service.scm.azurewebsites.net:443/msdeploy.axd?site=super-cool-service"; string websiteName = "super-cool-service"; string username = "******"; string password = "******"; var result = WebDeploy.FromPublishProfile(profile); Assert.Equal(server, result.Server); Assert.Equal(websiteName, result.Website); Assert.Equal(username, result.Username); Assert.Equal(password, result.Password); }
public IActionResult Index(string model, string apiToken = null) { WebDeploy result = null; try { result = WebDeploy.FromPublishProfile(model, apiToken); } catch (Exception) { return(BadRequest()); } return(Ok(result)); }
public void FromPublishProfile_NullXml_ThrowsException() { Assert.Throws <ArgumentNullException>(() => WebDeploy.FromPublishProfile(null)); Assert.Throws <ArgumentNullException>(() => WebDeploy.FromPublishProfile("")); Assert.Throws <ArgumentNullException>(() => WebDeploy.FromPublishProfile(" ")); }