Skip to content

Commit

Permalink
Merge pull request #724 from bcgov/yj
Browse files Browse the repository at this point in the history
chore: fix unit tests
  • Loading branch information
ychung-mot authored Oct 21, 2024
2 parents 1644937 + f6184ae commit 8cb5fd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/StrDss.Test/UserServiceShould.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task ValidateAccessRequestCreateDtoAsync_AccessRequestPending_Retur
{
// Arrange
userDto.AccessRequestStatusCd = AccessRequestStatuses.Requested;
userRepoMock.Setup(x => x.GetUserByGuid(It.IsAny<Guid>())).ReturnsAsync(userDto);
userRepoMock.Setup(x => x.GetUserByCurrentUser()).ReturnsAsync(userDto);

// Act
var errors = await sut.CreateAccessRequestAsync(dto);
Expand All @@ -75,7 +75,7 @@ public async Task ValidateAccessRequestCreateDtoAsync_AccessDisabled_ReturnsErro
// Arrange
userDto.AccessRequestStatusCd = AccessRequestStatuses.Approved;
userDto.IsEnabled = false;
userRepoMock.Setup(x => x.GetUserByGuid(It.IsAny<Guid>())).ReturnsAsync(userDto);
userRepoMock.Setup(x => x.GetUserByCurrentUser()).ReturnsAsync(userDto);

// Act
var errors = await sut.CreateAccessRequestAsync(dto);
Expand All @@ -96,7 +96,7 @@ public async Task ValidateAccessRequestCreateDtoAsync_AccessAlreadyApproved_Retu
{
// Arrange
userDto.AccessRequestStatusCd = AccessRequestStatuses.Approved;
userRepoMock.Setup(x => x.GetUserByGuid(It.IsAny<Guid>())).ReturnsAsync(userDto);
userRepoMock.Setup(x => x.GetUserByCurrentUser()).ReturnsAsync(userDto);

// Act
var errors = await sut.CreateAccessRequestAsync(dto);
Expand Down Expand Up @@ -312,7 +312,7 @@ private void SetupUserRepository(Mock<IUserRepository> userRepoMock, UserDto? us
{
int callCount = 0;

userRepoMock.Setup(x => x.GetUserByGuid(It.IsAny<Guid>()))
userRepoMock.Setup(x => x.GetUserByCurrentUser())
.ReturnsAsync(() =>
{
callCount++;
Expand Down

0 comments on commit 8cb5fd9

Please sign in to comment.