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.
abp/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/UserRoleFinder_Tests.cs

31 lines
870 B

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace Volo.Abp.Identity
{
public class UserRoleFinder_Tests : AbpIdentityDomainTestBase
{
private readonly IUserRoleFinder _userRoleFinder;
private readonly IdentityTestData _testData;
public UserRoleFinder_Tests()
{
_userRoleFinder = GetRequiredService<IUserRoleFinder>();
_testData = GetRequiredService<IdentityTestData>();
}
[Fact]
public async Task GetRolesAsync()
{
var roleNames = await _userRoleFinder.GetRolesAsync(_testData.UserJohnId);
roleNames.ShouldNotBeEmpty();
roleNames.ShouldContain(x => x == "moderator");
roleNames.ShouldContain(x => x == "supporter");
}
}
}