1
0

Send Text Message

This commit is contained in:
2025-12-02 22:49:51 +01:00
parent 23ad083d1d
commit 17ff8f7371
27 changed files with 2157 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
using System.Net.Http;
using AMWD.Net.Api.LinkMobility;
namespace LinkMobility.Tests.Auth
{
[TestClass]
public class AccessTokenAuthenticationTest
{
[TestMethod]
public void ShouldAddHeader()
{
// Arrange
string token = "test_token";
var auth = new AccessTokenAuthentication(token);
using var httpClient = new HttpClient();
// Act
auth.AddHeader(httpClient);
// Assert
Assert.IsTrue(httpClient.DefaultRequestHeaders.Contains("Authorization"));
Assert.AreEqual("Bearer", httpClient.DefaultRequestHeaders.Authorization.Scheme);
Assert.AreEqual(token, httpClient.DefaultRequestHeaders.Authorization.Parameter);
}
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
public void ShouldThrowArgumentNullExceptionForToken(string token)
{
// Arrange
// Act & Assert
Assert.ThrowsExactly<ArgumentNullException>(() => new AccessTokenAuthentication(token));
}
}
}