Moving folder structure

This commit is contained in:
2025-07-10 10:12:50 +02:00
parent 450aa5f1c9
commit 29f6c4ae81
172 changed files with 109 additions and 162 deletions

View File

@@ -0,0 +1,43 @@
using System.Net.Http;
using AMWD.Net.Api.Cloudflare;
namespace Cloudflare.Core.Tests.Auth
{
[TestClass]
public class ApiTokenAuthenticationTest
{
[TestMethod]
public void ShouldAddHeader()
{
// Arrange
string apiToken = "some-api-token";
var auth = new ApiTokenAuthentication(apiToken);
using var clt = new HttpClient();
// Act
auth.AddHeader(clt);
// Assert
Assert.IsTrue(clt.DefaultRequestHeaders.Contains("Authorization"));
Assert.AreEqual("Bearer", clt.DefaultRequestHeaders.Authorization.Scheme);
Assert.AreEqual(apiToken, clt.DefaultRequestHeaders.Authorization.Parameter);
}
[DataTestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
[ExpectedException(typeof(ArgumentNullException))]
public void ShouldArgumentNullExceptionForEmailAddress(string apiToken)
{
// Arrange
// Act
new ApiTokenAuthentication(apiToken);
// Assert - ArgumentNullException
}
}
}