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); }