コード例 #1
0
        public void ObfuscateUrlQueryDefault_ReturnsNotObfuscatedWhenQueryIsEmpty()
        {
            //Arrange
            Uri data = new Uri("https://localhost:550/users/account");

            // Act
            var obfuscated = RouteExtensions.ObfuscateUrlQuery(data, RouteExtensions.ObfuscatedReturnUrlMetadata);

            //Assert
            Assert.Equal(data.ToString(), obfuscated.ToString());
        }
コード例 #2
0
        public void ObfuscateUrlQuery_ReturnsObfuscatedUriWhenObfuscated(string input, string expected)
        {
            //Arrange
            Uri data = new Uri(input);

            // Act
            var obfuscated = RouteExtensions.ObfuscateUrlQuery(data, RouteExtensions.ObfuscatedReturnUrlMetadata);

            //Assert
            Assert.Equal(expected, obfuscated.ToString());
        }
コード例 #3
0
 public void ObfuscateUrlQueryDefault_ThrowWhenMetadataIsNull()
 {
     //Act + Assert
     Assert.Throws <ArgumentNullException>(() => RouteExtensions.ObfuscateUrlQuery(new Uri("https://localhost:550/users/account"), null));
 }
コード例 #4
0
 public void ObfuscateUrlQueryDefault_ThrowWhenUriNull()
 {
     //Act + Assert
     Assert.Throws <ArgumentNullException>(() => RouteExtensions.ObfuscateUrlQuery(null, RouteExtensions.ObfuscatedReturnUrlMetadata));
 }