Created CA follow up worker

This commit is contained in:
Chase Tucker
2024-04-11 13:20:33 -07:00
parent ed89f25dad
commit 83165bbdd7
16 changed files with 701 additions and 44 deletions

View File

@ -2,7 +2,6 @@ using FabApprovalWorkerService.Models;
using FabApprovalWorkerService.Services;
using Microsoft.Extensions.Logging;
using Microsoft.Identity.Client;
using Moq;
@ -73,7 +72,7 @@ internal class UserServiceTests {
}
[Test]
public async Task GetAllExpiredOOOUsersDbErrorShouldThrowException() {
public void GetAllExpiredOOOUsersDbErrorShouldThrowException() {
_mockDalService.Setup(d => d.QueryAsync<User>(It.IsAny<string>())).ThrowsAsync(new Exception("whoops!"));
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
@ -93,7 +92,7 @@ internal class UserServiceTests {
}
[Test]
public async Task GetAllPendingOOOUsersDbErrorShouldThrowException() {
public void GetAllPendingOOOUsersDbErrorShouldThrowException() {
_mockDalService.Setup(d => d.QueryAsync<OOOTemp>(It.IsAny<string>())).ThrowsAsync(new Exception("whoops!"));
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
@ -113,7 +112,7 @@ internal class UserServiceTests {
}
[Test]
public async Task IsUserAlreadyOOOWithInvalidUserIdShouldThrowException() {
public void IsUserAlreadyOOOWithInvalidUserIdShouldThrowException() {
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
Assert.ThrowsAsync<ArgumentException>(async Task () => await _userService.IsUserAlreadyOOO(0));
@ -153,7 +152,7 @@ internal class UserServiceTests {
}
[Test]
public async Task IsDelegatorAlreadyDelegatedToDbErrorShouldThrowException() {
public void IsDelegatorAlreadyDelegatedToDbErrorShouldThrowException() {
_mockDalService.Setup(d => d.QueryAsync<User>(It.IsAny<string>())).ThrowsAsync(new Exception("whoops!"));
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
@ -188,7 +187,7 @@ internal class UserServiceTests {
}
[Test]
public async Task InsertDelegatedRolesWithInvalidUserIdShouldThrowException() {
public void InsertDelegatedRolesWithInvalidUserIdShouldThrowException() {
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
Assert.ThrowsAsync<ArgumentException>(async Task () => await _userService.InsertDelegatedRoles(0));
@ -330,7 +329,7 @@ internal class UserServiceTests {
}
[Test]
public async Task FlagUserAsOOOWithNullOOOTempShouldThrowException() {
public void FlagUserAsOOOWithNullOOOTempShouldThrowException() {
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
Assert.ThrowsAsync<ArgumentNullException>(async Task () => await _userService.FlagUserAsOOO(null));
@ -373,7 +372,7 @@ internal class UserServiceTests {
}
[Test]
public async Task RemoveOOOFlagForUserWithInvalidIdShouldThrowException() {
public void RemoveOOOFlagForUserWithInvalidIdShouldThrowException() {
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
Assert.ThrowsAsync<ArgumentException>(async Task () => await _userService.RemoveOOOFlagForUser(0));
@ -389,7 +388,7 @@ internal class UserServiceTests {
}
[Test]
public async Task SetOOOTempProcessedWithNullOOOTempShouldThrowException() {
public void SetOOOTempProcessedWithNullOOOTempShouldThrowException() {
_userService = new UserService(MOCK_LOGGER, _mockDalService.Object);
Assert.ThrowsAsync<ArgumentNullException>(async Task () => await _userService.SetOOOTempProcessed(null));