Enhanced id validation, made url building more robust

This commit is contained in:
2024-11-10 16:43:56 +01:00
parent 42455e596b
commit e561ad8ee7
3 changed files with 31 additions and 3 deletions

View File

@@ -46,6 +46,21 @@ namespace Cloudflare.Tests.Extensions
// Assert - ArgumentOutOfRangeException
}
[DataTestMethod]
[DataRow("023e105f4ecef8ad9ca31a8372d0c35")]
[DataRow("023e105f4ecef8ad9ca31a8372d0C353")]
[DataRow("023e105f4ecef8ad9ca31a8372d0y353")]
[ExpectedException(typeof(ArgumentException))]
public void ShouldThrowArgumentExceptionForValidateId(string id)
{
// Arrange
// Act
id.ValidateCloudflareId();
// Assert - ArgumentException
}
[TestMethod]
public void ShouldValidateName()
{