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/TestLdapSettingValueProvide...

47 lines
1.2 KiB

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Settings;
namespace Volo.Abp.Ldap;
public class TestLdapSettingValueProvider : ISettingValueProvider, ITransientDependency
{
public const string ProviderName = "Test";
public string Name => ProviderName;
public Task<string> GetOrNullAsync(SettingDefinition setting)
{
switch (setting.Name)
{
case LdapSettingNames.ServerHost:
return Task.FromResult("localhost");
case LdapSettingNames.ServerPort:
return Task.FromResult("389");
case LdapSettingNames.BaseDc:
return Task.FromResult("dc=abp,dc=io");
case LdapSettingNames.Domain:
return Task.FromResult<string>(null);
case LdapSettingNames.UserName:
return Task.FromResult("admin");
case LdapSettingNames.Password:
return Task.FromResult("123qwe");
default:
return Task.FromResult<string>(null);
}
}
public Task<List<SettingValue>> GetAllAsync(SettingDefinition[] settings)
{
throw new NotImplementedException();
}
}