mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace Volo.Abp.PermissionManagement
|
|
{
|
|
public class PermissionDataSeeder_Tests : PermissionTestBase
|
|
{
|
|
private readonly IPermissionDataSeeder _permissionDataSeeder;
|
|
private readonly IPermissionGrantRepository _grantpermissionGrantRepository;
|
|
|
|
public PermissionDataSeeder_Tests()
|
|
{
|
|
_permissionDataSeeder = GetRequiredService<IPermissionDataSeeder>();
|
|
_grantpermissionGrantRepository = GetRequiredService<IPermissionGrantRepository>();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task SeedAsync()
|
|
{
|
|
(await _grantpermissionGrantRepository.FindAsync("MyPermission1", "Test", "Test")).ShouldBeNull();
|
|
(await _grantpermissionGrantRepository.FindAsync("MyPermission2", "Test", "Test")).ShouldBeNull();
|
|
|
|
await _permissionDataSeeder.SeedAsync("Test", "Test", new List<string>()
|
|
{
|
|
"MyPermission1",
|
|
"MyPermission2"
|
|
});
|
|
|
|
(await _grantpermissionGrantRepository.FindAsync("MyPermission1", "Test", "Test")).ShouldNotBeNull();
|
|
(await _grantpermissionGrantRepository.FindAsync("MyPermission2", "Test", "Test")).ShouldNotBeNull();
|
|
|
|
}
|
|
}
|
|
}
|