コード例 #1
0
        public void ToQueryString_DefaultPathIsNull_DoesNotAppearInQueryString()
        {
            // Arrange
            var options = new MultiFileUploadOptions {
                DefaultPath = null
            };

            // Act
            var queryString = options.ToQueryString();

            // Assert
            Assert.That(!queryString.Contains("defaultpath", StringComparison.OrdinalIgnoreCase));
        }
コード例 #2
0
        public void ToQueryString_DryRunIsFalse_DoesNotAppearInQueryString()
        {
            // Arrange
            var options = new MultiFileUploadOptions {
                DryRun = false
            };

            // Act
            var queryString = options.ToQueryString();

            // Assert
            Assert.That(!queryString.Contains("dryrun", StringComparison.OrdinalIgnoreCase));
        }
コード例 #3
0
        public void ToQueryString_DisableDefaultPathIsTrue_AppearsInQueryString()
        {
            // Arrange
            var options = new MultiFileUploadOptions {
                DisableDefaultPath = true
            };

            // Act
            var queryString = options.ToQueryString();

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(queryString.StartsWith('?'));
                Assert.That(queryString.Contains("disabledefaultpath=true", StringComparison.OrdinalIgnoreCase));
            });
        }
コード例 #4
0
        public void ToQueryString_FileNameIsSet_AppearsInQueryString()
        {
            // Arrange
            var options = new MultiFileUploadOptions {
                FileName = "allmyfiles"
            };

            // Act
            var queryString = options.ToQueryString();

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(queryString.StartsWith('?'));
                Assert.That(queryString.Contains($"filename=allmyfiles", StringComparison.OrdinalIgnoreCase));
            });
        }
コード例 #5
0
        public void ToQueryString_FileNameIsNull_AppearsAsDateTimeInQueryString()
        {
            // Arrange
            var options = new MultiFileUploadOptions {
                FileName = null
            };

            // Act
            var queryString = options.ToQueryString();

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(queryString.StartsWith('?'));
                Assert.That(Regex.IsMatch(queryString, @"filename=\d{4}-\d{2}-\d{2}%3A\d{2}-\d{2}-\d{2}"));
            });
        }
コード例 #6
0
        public void ToQueryString_DefaultPathIsSet_AppearsInQueryString()
        {
            // Arrange
            var options = new MultiFileUploadOptions {
                DefaultPath = "www/index.html"
            };

            // Act
            var queryString = options.ToQueryString();

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(queryString.StartsWith('?'));
                Assert.That(queryString.Contains("defaultpath=www%2Findex.html", StringComparison.OrdinalIgnoreCase));
            });
        }