public Project CreateProject(Action<INewProjectDetailsBuilder> newProjectDetailsBuilderAction) { var newProjectDetailsBuilder = new NewProjectDetailsBuilder(); newProjectDetailsBuilderAction(newProjectDetailsBuilder); var dataXml = newProjectDetailsBuilder.GetDataXml(); return m_TeamCityCaller.PostFormat<Project>(dataXml, HttpContentTypes.ApplicationXml, HttpContentTypes.ApplicationJson, "/app/rest/projects/"); }
public Project CreateProject(Action <INewProjectDetailsBuilder> newProjectDetailsBuilderAction) { var newProjectDetailsBuilder = new NewProjectDetailsBuilder(); newProjectDetailsBuilderAction(newProjectDetailsBuilder); var dataXml = newProjectDetailsBuilder.GetDataXml(); return(m_TeamCityCaller.PostFormat <Project>(dataXml, HttpContentTypes.ApplicationXml, HttpContentTypes.ApplicationJson, "/app/rest/projects/")); }
public void GetDataXml_Name_XmlFormatted() { // Arrange var newProjectDetailsBuilder = new NewProjectDetailsBuilder(); // Act newProjectDetailsBuilder.Name("New Project Name"); // Assert newProjectDetailsBuilder.GetDataXml() .Should() .Be( @"<newProjectDescription name='New Project Name'></newProjectDescription>"); }
public void GetDataXml_IdNameAndParent_XmlFormatted() { // Arrange var newProjectDetailsBuilder = new NewProjectDetailsBuilder(); // Act newProjectDetailsBuilder.Name("New Project Name") .Id("newProjectId") .ParentProject(x => x.Id("parentProjectId")); // Assert newProjectDetailsBuilder.GetDataXml() .Should() .Be( @"<newProjectDescription name='New Project Name' id='newProjectId'><parentProject locator='id:parentProjectId'/></newProjectDescription>"); }