Пример #1
0
        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>();
            }
        }
Пример #2
0
        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>();
            }
        }
Пример #3
0
        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);
        }