Get Availability and extension for all users
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using CPATapi.Server.Repository;
|
||||
|
||||
namespace CPATapi.Server.Tests;
|
||||
|
||||
public class ZeitConsensRepositoryTest
|
||||
{
|
||||
[OneTimeSetUp]
|
||||
public void Setup()
|
||||
{
|
||||
// the type specified here is just so the secrets library can
|
||||
// find the UserSecretId we added in the csproj file
|
||||
var builder = new ConfigurationBuilder().AddUserSecrets<ZeitConsensRepositoryTest>();
|
||||
|
||||
_configuration = builder.Build();
|
||||
}
|
||||
|
||||
private IConfigurationRoot _configuration { get; set; }
|
||||
|
||||
[Test]
|
||||
public async Task TestGetUsersAvailabilityAsync()
|
||||
{
|
||||
var zcRepo = new ZeitConsensRepository(_configuration);
|
||||
var availability= (await zcRepo.GetUsersAvailabilityAsync(DateTime.Now.Date, DateTime.Now.AddDays(1).Date)).ToList();
|
||||
Assert.That(availability, Is.Not.Empty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestGetUserAvailabilityAsync()
|
||||
{
|
||||
var zcRepo = new ZeitConsensRepository(_configuration);
|
||||
var availability = await zcRepo.GetUserAvailabilityAsync("CPATRD", DateTime.Now.Date, DateTime.Now.AddDays(1).Date);
|
||||
Assert.That(availability, Is.Not.Null);
|
||||
Assert.That(availability.MA_USER_NAME, Is.EqualTo("CPATRD"));
|
||||
Assert.That(availability.US_EXTENSION, Is.EqualTo("203"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user