Created tests for the core module

This commit is contained in:
2025-01-18 16:01:35 +01:00
parent a5062ec581
commit afe8a41f6c
20 changed files with 1097 additions and 26 deletions

View File

@@ -0,0 +1,41 @@
using HopFrame.Core.Services.Implementations;
namespace HopFrame.Core.Tests.Services;
public class DefaultAuthHandlerTests {
[Fact]
public async Task IsAuthenticatedAsync_ReturnsTrue() {
// Arrange
var authHandler = new DefaultAuthHandler();
// Act
var result = await authHandler.IsAuthenticatedAsync(null);
// Assert
Assert.True(result);
}
[Fact]
public async Task IsAuthenticatedAsync_WithPolicy_ReturnsTrue() {
// Arrange
var authHandler = new DefaultAuthHandler();
// Act
var result = await authHandler.IsAuthenticatedAsync("TestPolicy");
// Assert
Assert.True(result);
}
[Fact]
public async Task GetCurrentUserDisplayNameAsync_ReturnsEmptyString() {
// Arrange
var authHandler = new DefaultAuthHandler();
// Act
var result = await authHandler.GetCurrentUserDisplayNameAsync();
// Assert
Assert.Equal(string.Empty, result);
}
}