-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4424 from dfe-analytical-services/EES-4660-part-2
EES-4660 Part 2 - Begin setting Data Guidance on `ReleaseFile.Summary`
- Loading branch information
Showing
20 changed files
with
1,349 additions
and
263 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...reEducationStatistics.Admin.Tests/Services/DataGuidanceMigrationServicePermissionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} | ||
} |
Oops, something went wrong.