public void FolderCreatingWithExistedNameReturnErrorTest()
        {
            WebException exception = ExceptionsAsserting.AssertCatch <WebException>(() =>
                                                                                    ResourceHelper.TwiceCreateFolder(folderName));

            Assert.AreEqual("The remote server returned an error: (409) Conflict.", exception.Message);
        }
        public void SubfolderCreatingReturnErrorTest()
        {
            string       foldersName = @"Test/Test2";
            WebException exception   = ExceptionsAsserting.AssertCatch <WebException>(() =>
                                                                                      ResourceHelper.CreateResource(foldersName));

            Assert.AreEqual("The remote server returned an error: (409) Conflict.", exception.Message);
        }
        public void FileAlreadyExistResponseErrorTest()
        {
            string localFile = @"Test.txt";

            WebException exception = ExceptionsAsserting.AssertCatch <WebException>(() =>
                                                                                    UploadHelper.TwiceRequestUrlAndUploadFile(localFile, folderName));

            Assert.AreEqual("The remote server returned an error: (409) Conflict.", exception.Message, "Error (409) Conflict expected");
        }
        public void UnauthorizedRequestForUploadFileTest()
        {
            string uploadPath = @"disk:/Test";

            WebException exception = ExceptionsAsserting.AssertCatch <WebException>(() =>
                                                                                    UploadHelper.UnauthorizedRequestUrlForUploadFile(uploadPath));

            Assert.AreEqual("The remote server returned an error: (401) Unauthorized.", exception.Message);
        }
Exemple #5
0
        public void DeletingNonexistentFolderReturnErrorTest()
        {
            string nonexistentFolderName = @"NonexistentFolderName";

            WebException exception = ExceptionsAsserting.AssertCatch <WebException>(() =>
                                                                                    ResourceHelper.DeleteResource(nonexistentFolderName, true));

            Assert.AreEqual("The remote server returned an error: (404) Not Found.", exception.Message);
        }
        public void PathFormatIsNotSupportedForUploadTest()
        {
            string filePath   = @"https://www.w3.org/2008/site/images/logo-w3c-mobile-lg";
            string folderName = @"Test";

            Exception exception = ExceptionsAsserting.AssertCatch <Exception>(() =>
                                                                              UploadHelper.RequestUrlAndUploadFile(filePath, folderName));

            Assert.AreEqual("The given path's format is not supported.", exception.Message);
        }