Skip to content

Commit

Permalink
Merge pull request #4240 from dfe-analytical-services/EES-4448-FE
Browse files Browse the repository at this point in the history
EES-4448 - My Approvals tab
  • Loading branch information
duncan-at-hiveit authored Sep 22, 2023
2 parents e7f9952 + 03cfaa7 commit cc1c3cb
Show file tree
Hide file tree
Showing 84 changed files with 3,041 additions and 665 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using GovUk.Education.ExploreEducationStatistics.Admin.ViewModels;
using GovUk.Education.ExploreEducationStatistics.Admin.ViewModels.Methodology;
using GovUk.Education.ExploreEducationStatistics.Common.Model;
using GovUk.Education.ExploreEducationStatistics.Common.Services.Interfaces.Security;
using GovUk.Education.ExploreEducationStatistics.Common.Tests.Extensions;
using Microsoft.AspNetCore.Mvc;
using Moq;
Expand Down Expand Up @@ -245,15 +246,37 @@ public async void DeleteMethodologyVersion_Returns_NoContent()
result.AssertNoContent();
}

[Fact]
public async void ListMethodologyVersionsForApproval()
{
var methodologyVersions = ListOf(new MethodologyVersionViewModel
{
Id = Guid.NewGuid()
});

var userService = new Mock<IUserService>(Strict);
var methodologyService = new Mock<IMethodologyService>(Strict);

methodologyService
.Setup(s => s.ListUsersMethodologyVersionsForApproval())
.ReturnsAsync(methodologyVersions);

var controller = SetupMethodologyController(
methodologyService.Object);

var result = await controller.ListMethodologyVersionsForApproval();
VerifyAllMocks(userService, methodologyService);

result.AssertOkResult(methodologyVersions);
}

private static MethodologyController SetupMethodologyController(
IMethodologyService? methodologyService = null,
IMethodologyAmendmentService? methodologyAmendmentService = null
)
IMethodologyAmendmentService? methodologyAmendmentService = null)
{
return new(
methodologyService ?? Mock.Of<IMethodologyService>(Strict),
methodologyAmendmentService ?? Mock.Of<IMethodologyAmendmentService>(Strict)
);
methodologyAmendmentService ?? Mock.Of<IMethodologyAmendmentService>(Strict));
}
}
}
Loading

0 comments on commit cc1c3cb

Please sign in to comment.