Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using JdeScoping.Infrastructure.Auth;
|
||||
using Shouldly;
|
||||
|
||||
namespace JdeScoping.Infrastructure.Tests.Unit;
|
||||
|
||||
public class FakeAuthServiceTests
|
||||
{
|
||||
private readonly FakeAuthService _sut;
|
||||
|
||||
public FakeAuthServiceTests()
|
||||
{
|
||||
_sut = new FakeAuthService();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AuthenticateAsync_WithValidCredentials_ReturnsSuccess()
|
||||
{
|
||||
// Act
|
||||
var result = await _sut.AuthenticateAsync("testuser", "password");
|
||||
|
||||
// Assert
|
||||
result.Success.ShouldBeTrue();
|
||||
result.User.ShouldNotBeNull();
|
||||
result.User.Username.ShouldBe("testuser");
|
||||
result.User.EmailAddress.ShouldBe("testuser@example.com");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AuthenticateAsync_AnyCredentials_ReturnsSuccess()
|
||||
{
|
||||
// FakeAuthService accepts any non-empty credentials
|
||||
var result = await _sut.AuthenticateAsync("anyuser", "anypassword");
|
||||
|
||||
// Assert
|
||||
result.Success.ShouldBeTrue();
|
||||
result.User.ShouldNotBeNull();
|
||||
result.ErrorMessage.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetUserInfoAsync_ReturnsUserInfo()
|
||||
{
|
||||
// Act
|
||||
var result = await _sut.GetUserInfoAsync("testuser");
|
||||
|
||||
// Assert
|
||||
result.ShouldNotBeNull();
|
||||
result.Username.ShouldBe("testuser");
|
||||
result.FirstName.ShouldBe("Dev");
|
||||
result.LastName.ShouldBe("User");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task IsInGroupAsync_AlwaysReturnsTrue()
|
||||
{
|
||||
// Act
|
||||
var result = await _sut.IsInGroupAsync("testuser", "AnyGroup");
|
||||
|
||||
// Assert
|
||||
result.ShouldBeTrue();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user