public async Task Delete_Language() { //Arrange System.Collections.Generic.IReadOnlyList <ApplicationLanguage> currentLanguages = await _languageManager.GetLanguagesAsync(AbpSession.TenantId); ApplicationLanguage randomLanguage = RandomHelper.GetRandomOf(currentLanguages.ToArray()); //Act await _languageAppService.DeleteLanguage(new EntityDto(randomLanguage.Id)); //Assert currentLanguages = await _languageManager.GetLanguagesAsync(AbpSession.TenantId); currentLanguages.Any(l => l.Name == randomLanguage.Name).ShouldBeFalse(); }
public async Task SetDefaultLanguage() { //Arrange System.Collections.Generic.IReadOnlyList <ApplicationLanguage> currentLanguages = await _languageManager.GetLanguagesAsync(AbpSession.TenantId); ApplicationLanguage randomLanguage = RandomHelper.GetRandomOf(currentLanguages.ToArray()); //Act await _languageAppService.SetDefaultLanguage( new SetDefaultLanguageInput { Name = randomLanguage.Name }); //Assert ApplicationLanguage defaultLanguage = await _languageManager.GetDefaultLanguageOrNullAsync(AbpSession.TenantId); randomLanguage.ShouldBe(defaultLanguage); }