mirror of https://github.com/abpframework/abp.git
8 changed files with 74 additions and 7 deletions
@ -0,0 +1,27 @@ |
|||
using System.Threading.Tasks; |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.PermissionManagement; |
|||
|
|||
public abstract class PermissionDefinitionRecordRepository_Tests : PermissionTestBase |
|||
{ |
|||
protected IPermissionDefinitionRecordRepository PermissionDefinitionRecordRepository { get; set; } |
|||
|
|||
protected PermissionDefinitionRecordRepository_Tests() |
|||
{ |
|||
PermissionDefinitionRecordRepository = GetRequiredService<IPermissionDefinitionRecordRepository>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task FindByNameAsync() |
|||
{ |
|||
var permission = await PermissionDefinitionRecordRepository.FindByNameAsync("MyPermission1"); |
|||
permission.ShouldNotBeNull(); |
|||
permission.Name.ShouldBe("MyPermission1"); |
|||
|
|||
permission = await PermissionDefinitionRecordRepository.FindByNameAsync("MyPermission2"); |
|||
permission.ShouldNotBeNull(); |
|||
permission.Name.ShouldBe("MyPermission2"); |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
namespace Volo.Abp.PermissionManagement; |
|||
|
|||
public class StaticPermissionSaver_Tests : PermissionTestBase |
|||
{ |
|||
private readonly IStaticPermissionSaver _saver; |
|||
|
|||
public StaticPermissionSaver_Tests() |
|||
{ |
|||
_saver = GetRequiredService<IStaticPermissionSaver>(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|||
|
|||
public class EFCorePermissionDefinitionRecordRepository_Tests : PermissionDefinitionRecordRepository_Tests |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.PermissionManagement.MongoDB; |
|||
|
|||
[Collection(MongoTestCollection.Name)] |
|||
public class MongoDbPermissionDefinitionRecordRepository_Tests : PermissionGrantRepository_Tests<AbpPermissionManagementMongoDbTestModule> |
|||
{ |
|||
|
|||
} |
|||
Loading…
Reference in new issue