public void ToString_ReturnsThePropertyValues() { // Arrange var corsPolicy = new CorsPolicy { PreflightMaxAge = TimeSpan.FromSeconds(12), SupportsCredentials = true }; corsPolicy.Headers.Add("foo"); corsPolicy.Headers.Add("bar"); corsPolicy.Origins.Add("http://example.com"); corsPolicy.Origins.Add("http://example.org"); corsPolicy.Methods.Add("GET"); // Act var policyString = corsPolicy.ToString(); // Assert Assert.Equal( @"AllowAnyHeader: False, AllowAnyMethod: False, AllowAnyOrigin: False, PreflightMaxAge: 12," + " SupportsCredentials: True, Origins: {http://example.com,http://example.org}, Methods: {GET}," + " Headers: {foo,bar}, ExposedHeaders: {}", policyString); }
public void ToString_ReturnsThePropertyValues() { CorsPolicy corsPolicy = new CorsPolicy { AllowAnyHeader = true, AllowAnyOrigin = true, PreflightMaxAge = 10, SupportsCredentials = true }; corsPolicy.Headers.Add("foo"); corsPolicy.Headers.Add("bar"); corsPolicy.Origins.Add("http://example.com"); corsPolicy.Origins.Add("http://example.org"); corsPolicy.Methods.Add("GET"); Assert.Equal(@"AllowAnyHeader: True, AllowAnyMethod: False, AllowAnyOrigin: True, PreflightMaxAge: 10, SupportsCredentials: True, Origins: {http://example.com,http://example.org}, Methods: {GET}, Headers: {foo,bar}, ExposedHeaders: {}", corsPolicy.ToString()); }
public void ToString_ReturnsThePropertyValues() { CorsPolicy corsPolicy = new CorsPolicy { AllowAnyHeader = true, AllowAnyOrigin = true, PreflightMaxAge = 10, SupportsCredentials = true }; corsPolicy.Headers.Add("foo"); corsPolicy.Headers.Add("bar"); corsPolicy.Origins.Add("http://example.com"); corsPolicy.Origins.Add("http://example.org"); corsPolicy.Methods.Add("GET"); Assert.Equal( @"AllowAnyHeader: True, AllowAnyMethod: False, AllowAnyOrigin: True, PreflightMaxAge: 10, SupportsCredentials: True, Origins: {http://example.com,http://example.org}, Methods: {GET}, Headers: {foo,bar}, ExposedHeaders: {}", corsPolicy.ToString() ); }
public void ToString_ReturnsThePropertyValues() { // Arrange var corsPolicy = new CorsPolicy { PreflightMaxAge = TimeSpan.FromSeconds(12), SupportsCredentials = true }; corsPolicy.Headers.Add("foo"); corsPolicy.Headers.Add("bar"); corsPolicy.Origins.Add("http://example.com"); corsPolicy.Origins.Add("http://example.org"); corsPolicy.Methods.Add("GET"); // Act var policyString = corsPolicy.ToString(); // Assert Assert.Equal( @"AllowAnyHeader: False, AllowAnyMethod: False, AllowAnyOrigin: False, PreflightMaxAge: 12,"+ " SupportsCredentials: True, Origins: {http://example.com,http://example.org}, Methods: {GET},"+ " Headers: {foo,bar}, ExposedHeaders: {}", policyString); }