コード例 #1
0
        public async Task When_Passing_No_Translation_Codes_Then_Exception_Is_Raised()
        {
            // ARRANGE
            InitializeFakeObjects();

            // ACT & ASSERT
            await Assert.ThrowsAsync <ArgumentNullException>(() => _translationManager.GetTranslationsAsync(string.Empty, null));
        }
コード例 #2
0
        protected async Task TranslateView(string uiLocales)
        {
            var translations = await _translationManager.GetTranslationsAsync(uiLocales, new List <string>
            {
                Constants.StandardTranslationCodes.LoginCode,
                Constants.StandardTranslationCodes.UserNameCode,
                Constants.StandardTranslationCodes.PasswordCode,
                Constants.StandardTranslationCodes.RememberMyLoginCode,
                Constants.StandardTranslationCodes.LoginLocalAccount,
                Constants.StandardTranslationCodes.LoginExternalAccount,
                Constants.StandardTranslationCodes.SendCode,
                Constants.StandardTranslationCodes.Code,
                Constants.StandardTranslationCodes.ConfirmCode,
                Constants.StandardTranslationCodes.SendConfirmationCode,
                Constants.StandardTranslationCodes.UpdateClaim,
                Constants.StandardTranslationCodes.ConfirmationCode,
                Constants.StandardTranslationCodes.ResetConfirmationCode,
                Constants.StandardTranslationCodes.ValidateConfirmationCode,
                Constants.StandardTranslationCodes.Phone,
                Constants.StandardTranslationCodes.Email,
                Constants.StandardTranslationCodes.ActualPassword,
                Constants.StandardTranslationCodes.ConfirmActualPassword,
                Constants.StandardTranslationCodes.NewPassword,
                Constants.StandardTranslationCodes.ConfirmNewPassword,
                Constants.StandardTranslationCodes.Update,
                Constants.StandardTranslationCodes.RenewPassword
            }).ConfigureAwait(false);

            ViewBag.Translations = translations;
        }
コード例 #3
0
        private async Task TranslateUserEditView(string uiLocales)
        {
            var translations = await _translationManager.GetTranslationsAsync(uiLocales, new List <string>
            {
                Core.Constants.StandardTranslationCodes.LoginCode,
                Core.Constants.StandardTranslationCodes.EditResourceOwner,
                Core.Constants.StandardTranslationCodes.NameCode,
                Core.Constants.StandardTranslationCodes.YourName,
                Core.Constants.StandardTranslationCodes.PasswordCode,
                Core.Constants.StandardTranslationCodes.YourPassword,
                Core.Constants.StandardTranslationCodes.Email,
                Core.Constants.StandardTranslationCodes.YourEmail,
                Core.Constants.StandardTranslationCodes.ConfirmCode,
                Core.Constants.StandardTranslationCodes.TwoAuthenticationFactor,
                Core.Constants.StandardTranslationCodes.UserIsUpdated,
                Core.Constants.StandardTranslationCodes.Phone,
                Core.Constants.StandardTranslationCodes.HashedPassword,
                Core.Constants.StandardTranslationCodes.CreateResourceOwner,
                Core.Constants.StandardTranslationCodes.Credentials,
                Core.Constants.StandardTranslationCodes.RepeatPassword,
                Core.Constants.StandardTranslationCodes.Claims,
                Core.Constants.StandardTranslationCodes.UserIsCreated,
                Core.Constants.StandardTranslationCodes.TwoFactor,
                Core.Constants.StandardTranslationCodes.NoTwoFactorAuthenticator,
                Core.Constants.StandardTranslationCodes.NoTwoFactorAuthenticatorSelected
            });

            ViewBag.Translations = translations;
        }
コード例 #4
0
        private async Task TranslateUserEditView(string uiLocales)
        {
            var translations = await _translationManager.GetTranslationsAsync(uiLocales, new List <string>
            {
                Core.Constants.StandardTranslationCodes.EditCredentialsLink,
                Core.Constants.StandardTranslationCodes.ConfirmCode,
                Core.Constants.StandardTranslationCodes.TwoFactor,
                Core.Constants.StandardTranslationCodes.NoTwoFactorAuthenticator,
                Core.Constants.StandardTranslationCodes.NoTwoFactorAuthenticatorSelected,
                Core.Constants.StandardTranslationCodes.UserIsUpdated
            });

            ViewBag.Translations = translations;
        }
コード例 #5
0
        private async Task TranslateConsentScreen(string uiLocales)
        {
            // Retrieve the translation and store them in a ViewBag
            var translations = await _translationManager.GetTranslationsAsync(uiLocales, new List <string>
            {
                Core.Constants.StandardTranslationCodes.ApplicationWouldLikeToCode,
                Core.Constants.StandardTranslationCodes.IndividualClaimsCode,
                Core.Constants.StandardTranslationCodes.ScopesCode,
                Core.Constants.StandardTranslationCodes.CancelCode,
                Core.Constants.StandardTranslationCodes.ConfirmCode,
                Core.Constants.StandardTranslationCodes.LinkToThePolicy,
                Core.Constants.StandardTranslationCodes.Tos
            });

            ViewBag.Translations = translations;
        }
コード例 #6
0
        private async Task TranslateView(string uiLocales)
        {
            var translations = await _translationManager.GetTranslationsAsync(uiLocales, new List <string>
            {
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.LoginCode,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.UserNameCode,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.PasswordCode,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.RememberMyLoginCode,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.LoginLocalAccount,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.LoginExternalAccount,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.SendCode,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.Code,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.ConfirmCode,
                SimpleIdentityServer.Core.Constants.StandardTranslationCodes.SendConfirmationCode
            });

            ViewBag.Translations = translations;
        }
コード例 #7
0
        private async Task TranslateUserEditView(string uiLocales)
        {
            var translations = await _translationManager.GetTranslationsAsync(uiLocales, new List <string>
            {
                Core.Constants.StandardTranslationCodes.LoginCode,
                Core.Constants.StandardTranslationCodes.EditResourceOwner,
                Core.Constants.StandardTranslationCodes.ConfirmCode,
                Core.Constants.StandardTranslationCodes.UserIsUpdated,
                Core.Constants.StandardTranslationCodes.RepeatPassword,
                Core.Constants.StandardTranslationCodes.ActualPassword,
                Core.Constants.StandardTranslationCodes.ConfirmActualPassword,
                Core.Constants.StandardTranslationCodes.NewPassword,
                Core.Constants.StandardTranslationCodes.ConfirmNewPassword,
                Core.Constants.StandardTranslationCodes.Credentials
            });

            ViewBag.Translations = translations;
        }