public async Task UploadDirectory_NonRecursive_ExpectedSkylink()
        {
            // Arrange
            var fileProvider = new InMemoryFileProvider();

            fileProvider.Directory.AddFile("", new StringFileInfo("this file exists", "exists.txt"));
            fileProvider.Directory.AddFile("", new StringFileInfo("file contents", "foo.txt"));
            fileProvider.Directory.AddFile("foo", new StringFileInfo("{ \"another\":\"file\" }", "bar.json"));

            var options = new MultiFileUploadOptions {
                FileName = "integration-tests"
            };

            // Act
            var skylink = await _skynetWebPortal.UploadDirectory(fileProvider, "", false, options);

            // Assert
            Assert.That(skylink.ToString() == "AABU1QK8EVh5O47wX2qYyXQrzgRu7sl_ty5lWluhVzEFCw");
        }
        public void UploadDirectory_FileProviderIsTypeNullFileProvider_ThrowsArgumentException()
        {
            // Arrange
            using var httpClient = SetUpHttpClientThatReturns(HttpStatusCode.OK, JsonSerializer.Serialize(ValidUploadResponse));
            var webPortalClient = new SkynetWebPortal(httpClient);

            // Act
            Task UploadRequest() => webPortalClient.UploadDirectory(new NullFileProvider(), "");

            // Assert
            Assert.That(UploadRequest, Throws.ArgumentException);
        }
        public void UploadDirectory_DirectoryPathExists_ThrowsNothing()
        {
            // Arrange
            using var httpClient = SetUpHttpClientThatReturns(HttpStatusCode.OK, JsonSerializer.Serialize(ValidUploadResponse));
            var webPortalClient = new SkynetWebPortal(httpClient);
            var fileProvider    = SetUpFileProvider();

            // Act
            Task UploadRequest() => webPortalClient.UploadDirectory(fileProvider, "");

            // Assert
            Assert.That(UploadRequest, Throws.Nothing);
        }
        public void UploadDirectory_DirectoryPathDoesNotExist_ThrowsDirectoryNotFoundException()
        {
            // Arrange
            using var httpClient = SetUpHttpClientThatReturns(HttpStatusCode.OK, JsonSerializer.Serialize(ValidUploadResponse));
            var webPortalClient = new SkynetWebPortal(httpClient);
            var fileProvider    = SetUpFileProvider();

            // Act
            Task UploadRequest() => webPortalClient.UploadDirectory(fileProvider, "non-existant-directory");

            // Assert
            Assert.That(UploadRequest, Throws.TypeOf <DirectoryNotFoundException>());
        }
        public async Task UploadDirectory_DirectoryPathExists_ReturnsSkylink()
        {
            // Arrange
            using var httpClient = SetUpHttpClientThatReturns(HttpStatusCode.OK, JsonSerializer.Serialize(ValidUploadResponse));
            var webPortalClient = new SkynetWebPortal(httpClient);
            var fileProvider    = SetUpFileProvider();

            // Act
            var response = await webPortalClient.UploadDirectory(fileProvider, "");

            // Assert
            Assert.That(response, Is.EqualTo(Skylink.Parse(ValidUploadResponse.Skylink)));
        }