public Update ( string projectId, string name = null, string description = null ) : Task |
||
projectId | string | Existing project's id. |
name | string | New name of specified project. |
description | string | New description of specified project. |
Résultat | Task |
public async Task Update_WithNoProjectId_ThrowsException(ProjectSyncanoClient client) { try { //when await client.Update(null); throw new Exception("Update should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<ArgumentNullException>(); } }
public async Task Update_WithNoNewValues(ProjectSyncanoClient client) { //given string projectName = "UpdateProject test " + DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString(); var project = await client.New(projectName); //when project = await client.Update(project.Id); //then project.ShouldNotBeNull(); project.Name.ShouldEqual(projectName); project.Description.ShouldBeNull(); //cleanup await client.Delete(project.Id); }
public async Task Update_WithInvalidProjectId_ThrowsException(ProjectSyncanoClient client) { try { //when await client.Update("abc"); throw new Exception("Update should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<SyncanoException>(); } }
public async Task Update_CreatesProjectObjectWithNewValues(ProjectSyncanoClient client) { //given var projectName = "UpdateProject test " + DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString(); var projectNewName = "UpdateProject test new name" + DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString(); const string projectOldDescription = "qwerty"; const string projectNewDescription = "abc"; var project = await client.New(projectName, projectOldDescription); //when project = await client.Update(project.Id, projectNewName, projectNewDescription); //then project.ShouldNotBeNull(); project.Name.ShouldEqual(projectNewName); project.Description.ShouldEqual(projectNewDescription); //cleanup await client.Delete(project.Id); }