Created tests for the core module
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user