Change from DataTestMethod to TestMethod due to obsolete attribute

This commit is contained in:
2025-08-04 15:46:47 +02:00
parent 5697b8f921
commit 874ea58d87
24 changed files with 131 additions and 131 deletions

View File

@@ -28,7 +28,7 @@ namespace Cloudflare.Core.Tests.Auth
Assert.AreEqual(apiKey, clt.DefaultRequestHeaders.GetValues("X-Auth-Key").First());
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -44,7 +44,7 @@ namespace Cloudflare.Core.Tests.Auth
// Assert - ArgumentNullException
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -60,7 +60,7 @@ namespace Cloudflare.Core.Tests.Auth
// Assert - ArgumentNullException
}
[DataTestMethod]
[TestMethod]
[DataRow("test")]
[DataRow("test@example")]
[DataRow("example.com")]

View File

@@ -25,7 +25,7 @@ namespace Cloudflare.Core.Tests.Auth
Assert.AreEqual(apiToken, clt.DefaultRequestHeaders.Authorization.Parameter);
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]

View File

@@ -179,7 +179,7 @@ namespace Cloudflare.Core.Tests
// Assert - ArgumentOutOfRangeException
}
[DataTestMethod]
[TestMethod]
[DataRow(-1)]
[DataRow(11)]
[ExpectedException(typeof(ArgumentOutOfRangeException))]

View File

@@ -57,7 +57,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
// Assert - ObjectDisposedException
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -137,7 +137,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
VerifyNoOtherCalls();
}
[DataTestMethod]
[TestMethod]
[DataRow(HttpStatusCode.Unauthorized)]
[DataRow(HttpStatusCode.Forbidden)]
public async Task ShouldThrowAuthenticationExceptionOnStatusCode(HttpStatusCode statusCode)

View File

@@ -57,7 +57,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
// Assert - ObjectDisposedException
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -137,7 +137,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
VerifyNoOtherCalls();
}
[DataTestMethod]
[TestMethod]
[DataRow(HttpStatusCode.Unauthorized)]
[DataRow(HttpStatusCode.Forbidden)]
public async Task ShouldThrowAuthenticationExceptionOnStatusCode(HttpStatusCode statusCode)
@@ -165,7 +165,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
}
}
[DataTestMethod]
[TestMethod]
[DataRow(HttpStatusCode.Unauthorized)]
[DataRow(HttpStatusCode.Forbidden)]
public async Task ShouldThrowAuthenticationExceptionOnStatusCodeWithoutErrors(HttpStatusCode statusCode)
@@ -193,7 +193,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
}
}
[DataTestMethod]
[TestMethod]
[DataRow(HttpStatusCode.Unauthorized)]
[DataRow(HttpStatusCode.Forbidden)]
[ExpectedException(typeof(CloudflareException))]

View File

@@ -65,7 +65,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
// Assert - ObjectDisposedException
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -197,7 +197,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
VerifyNoOtherCalls();
}
[DataTestMethod]
[TestMethod]
[DataRow(HttpStatusCode.Unauthorized)]
[DataRow(HttpStatusCode.Forbidden)]
public async Task ShouldThrowAuthenticationExceptionOnStatusCode(HttpStatusCode statusCode)

View File

@@ -65,7 +65,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
// Assert - ObjectDisposedException
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -245,7 +245,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
_httpHandlerMock.Mock.Protected().Verify("SendAsync", Times.Once(), ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>());
}
[DataTestMethod]
[TestMethod]
[DataRow(HttpStatusCode.Unauthorized)]
[DataRow(HttpStatusCode.Forbidden)]
public async Task ShouldThrowAuthenticationExceptionOnStatusCode(HttpStatusCode statusCode)

View File

@@ -65,7 +65,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
// Assert - ObjectDisposedException
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -245,7 +245,7 @@ namespace Cloudflare.Core.Tests.CloudflareClientTests
_httpHandlerMock.Mock.Protected().Verify("SendAsync", Times.Once(), ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>());
}
[DataTestMethod]
[TestMethod]
[DataRow(HttpStatusCode.Unauthorized)]
[DataRow(HttpStatusCode.Forbidden)]
public async Task ShouldThrowAuthenticationExceptionOnStatusCode(HttpStatusCode statusCode)

View File

@@ -18,7 +18,7 @@ namespace Cloudflare.Tests.Extensions
// Assert - no exception thrown
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -46,7 +46,7 @@ namespace Cloudflare.Tests.Extensions
// Assert - ArgumentException
}
[DataTestMethod]
[TestMethod]
[DataRow("023e105f4ecef8ad9ca31a8372d0c35")]
[DataRow("023e105f4ecef8ad9ca31a8372d0C353")]
[DataRow("023e105f4ecef8ad9ca31a8372d0y353")]
@@ -73,7 +73,7 @@ namespace Cloudflare.Tests.Extensions
// Assert - no exception thrown
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -113,7 +113,7 @@ namespace Cloudflare.Tests.Extensions
// Assert - no exception thrown
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
@@ -128,7 +128,7 @@ namespace Cloudflare.Tests.Extensions
// Assert - ArgumentNullException
}
[DataTestMethod]
[TestMethod]
[DataRow("test")]
[DataRow("test@example")]
[DataRow("example.com")]
@@ -143,7 +143,7 @@ namespace Cloudflare.Tests.Extensions
// Assert - ArgumentException
}
[DataTestMethod]
[TestMethod]
[DataRow(null)]
[DataRow("SomeExampleString")]
public void ShouldValidateLength(string str)