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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using Microsoft.AspNetCore.Identity ;
using Shouldly ;
using Volo.Abp.Localization ;
using Xunit ;
namespace Volo.Abp.Identity
{
public class AbpIdentityResultException_Tests : AbpIdentityDomainTestBase
{
[Fact]
public void Should_Localize_Messages ( )
{
var exception = new AbpIdentityResultException (
IdentityResult . Failed (
new IdentityError
{
Code = "PasswordTooShort" ,
Description = "Passwords must be at least 6 characters."
} ,
new IdentityError
{
Code = "PasswordRequiresNonAlphanumeric" ,
Description = "Passwords must have at least one non alphanumeric character."
}
)
) ;
using ( CultureHelper . Use ( "tr" ) )
{
var localizeMessage = exception . LocalizeMessage ( new LocalizationContext ( ServiceProvider ) ) ;
localizeMessage . ShouldContain ( "Şifre en az 6 karakter uzunluğunda olmalı ." ) ;
localizeMessage . ShouldContain ( "Şifre en az bir sayı ya da harf olmayan karakter içermeli." ) ;
}
}
}
}