public GetOne ( string projectId, string folderName, string collectionId = null, string collectionKey = null ) : Task |
||
projectId | string | Project id. |
folderName | string | Folder name defining folder. |
collectionId | string | Collection id defining a collection for which the folder will be returned. |
collectionKey | string | Collection key defining a collection for which the folder will be returned. |
Результат | Task |
public async Task GetOne_WithNullProjectId_ThrowsException(FolderSyncanoClient client) { try { //when await client.GetOne(null, TestData.FolderName, TestData.CollectionId); throw new Exception("GetOne should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<ArgumentNullException>(); } }
public async Task GetOne_WithInvalidFolderName_ThrowsException(FolderSyncanoClient client) { try { //when await client.GetOne(TestData.ProjectId, "abcde", TestData.CollectionId); throw new Exception("GetOne should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<SyncanoException>(); } }
public async Task GetOne_ByCollectionKey(FolderSyncanoClient client) { //when var folder = await client.GetOne(TestData.ProjectId, TestData.FolderName, collectionKey: TestData.CollectionKey); //then folder.Id.ShouldEqual(TestData.FolderId); folder.Name.ShouldEqual(TestData.FolderName); }