Skip to content

Commit

Permalink
Merge pull request #4424 from dfe-analytical-services/EES-4660-part-2
Browse files Browse the repository at this point in the history
EES-4660 Part 2 - Begin setting Data Guidance on `ReleaseFile.Summary`
  • Loading branch information
benoutram authored Nov 27, 2023
2 parents adf7c06 + df2f07f commit 60072c2
Show file tree
Hide file tree
Showing 20 changed files with 1,349 additions and 263 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#nullable enable
using System.Threading.Tasks;
using GovUk.Education.ExploreEducationStatistics.Admin.Security;
using GovUk.Education.ExploreEducationStatistics.Admin.Services;
using GovUk.Education.ExploreEducationStatistics.Common.Services.Interfaces.Security;
using GovUk.Education.ExploreEducationStatistics.Content.Model.Database;
using GovUk.Education.ExploreEducationStatistics.Data.Model.Database;
using Moq;
using Xunit;
using static GovUk.Education.ExploreEducationStatistics.Admin.Tests.Services.PermissionTestUtil;

namespace GovUk.Education.ExploreEducationStatistics.Admin.Tests.Services;

/// <summary>
/// TODO EES-4661 Remove after the EES-4660 data guidance migration is successful
/// </summary>
public class DataGuidanceMigrationServicePermissionTests
{
[Fact]
public async Task MigrateDataGuidance()
{
await PolicyCheckBuilder()
.SetupCheck(SecurityPolicies.IsBauUser, false)
.AssertForbidden(
async userService =>
{
var service = SetupService(userService: userService.Object);
return await service.MigrateDataGuidance();
}
);
}

private static DataGuidanceMigrationService SetupService(IUserService userService)
{
return new DataGuidanceMigrationService(
Mock.Of<ContentDbContext>(),
Mock.Of<StatisticsDbContext>(),
userService
);
}
}
Loading

0 comments on commit 60072c2

Please sign in to comment.