yale-user-access/packages/backend/Services/MockYaleAccessor.cs

31 lines
785 B
C#
Raw Normal View History

2025-01-10 08:37:18 +11:00
using YaleAccess.Models;
using YaleAccess.Services.Interfaces;
namespace YaleAccess.Services
{
public class MockYaleAccessor : IYaleAccessor
{
private readonly MockYaleData _data;
public MockYaleAccessor(MockYaleData data)
{
_data = data;
}
public Task<YaleUserCode> GetCodeInformationAsync(int userCodeId)
{
return Task.FromResult(_data.GetUserCode(userCodeId));
}
public Task<bool> SetCodeAsAvailable(int userCode)
{
return Task.FromResult(_data.SetUserCodeAsAvailable(userCode));
}
public Task<bool> SetUserCode(int userCodeId, string code)
{
return Task.FromResult(_data.SetUserCode(userCodeId, code));
}
}
}