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/framework/test/Volo.Abp.Ldap.Tests/Volo/Abp/Ldap/LdapManager_Tests.cs

31 lines
940 B

using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.Testing;
using Xunit;
namespace Volo.Abp.Ldap
{
public class LdapManager_Tests : AbpIntegratedTest<AbpLdapTestModule>
{
private readonly ILdapManager _ldapManager;
public LdapManager_Tests()
{
_ldapManager = GetRequiredService<ILdapManager>();
}
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
[Fact(Skip = "Required Ldap environment")]
public async Task AuthenticateAsync()
{
(await _ldapManager.AuthenticateAsync("cn=abp,dc=abp,dc=io", "123qwe")).ShouldBe(true);
(await _ldapManager.AuthenticateAsync("cn=abp,dc=abp,dc=io", "123123")).ShouldBe(false);
(await _ldapManager.AuthenticateAsync("NoExists", "123qwe")).ShouldBe(false);
}
}
}