public Update ( string projectId, string name, string collectionId = null, string collectionKey = null, string newName = null, string sourceId = null ) : Task |
||
projectId | string | Project id. |
name | string | Current folder name. |
collectionId | string | Collection id defining collection where folder exists. |
collectionKey | string | Collection key defining collection where folder exists. |
newName | string | New folder name. |
sourceId | string | New source id, can be used for mapping folders to external source. |
return | Task |
public async Task Update_WithNullProjectId_ThrowsException(FolderSyncanoClient client) { try { //when await client.Update(null, TestData.FolderName, TestData.CollectionId); throw new Exception("Update should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<ArgumentNullException>(); } }
public async Task Update_WithInvalidFolderName_ThrowsException(FolderSyncanoClient client) { try { //when await client.Update(TestData.ProjectId, "abcde", TestData.CollectionId); throw new Exception("Update should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<SyncanoException>(); } }
public async Task Update_ByCollectionKey(FolderSyncanoClient client) { //given string folderName = "Test " + DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString(); string newFolderName = "Update test " + DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString(); await client.New(TestData.ProjectId, folderName, TestData.CollectionId); //when var result = await client.Update(TestData.ProjectId, folderName, null, TestData.CollectionKey, newFolderName, "qwerty"); //then result.ShouldBeTrue(); //cleanup await client.Delete(TestData.ProjectId, newFolderName, collectionKey: TestData.CollectionKey); }