public void GetNormalizedOrigin_ReturnsPunyCodedOrigin(string origin, string expected) { // Act var normalizedOrigin = CorsPolicyBuilder.GetNormalizedOrigin(origin); // Assert Assert.Equal(expected, normalizedOrigin); }
public void GetNormalizedOrigin_PreservesPort_ForNonIdnHosts(string origin, string expected) { // Act var normalizedOrigin = CorsPolicyBuilder.GetNormalizedOrigin(origin); // Assert Assert.Equal(expected, normalizedOrigin); }
public void GetNormalizedOrigin_ReturnsLowerCasedValue_IfStringIsNotHttpOrHttpsUrl(string origin, string expected) { // Act var normalizedOrigin = CorsPolicyBuilder.GetNormalizedOrigin(origin); // Assert Assert.Equal(expected, normalizedOrigin); }
public void GetNormalizedOrigin_LowerCasesHost() { // Arrange var origin = "http://www.Example.Com"; // Act var normalizedOrigin = CorsPolicyBuilder.GetNormalizedOrigin(origin); // Assert Assert.Equal("http://www.example.com", normalizedOrigin); }
public void GetNormalizedOrigin_DoesNotAddPort_IfUriDoesNotSpecifyOne() { // Arrange var origin = "http://www.example.com"; // Act var normalizedOrigin = CorsPolicyBuilder.GetNormalizedOrigin(origin); // Assert Assert.Equal(origin, normalizedOrigin); }