Removes GetLanguageByCultureCode since it is kind of useless and the name is also very misleading

This commit is contained in:
Shannon
2018-04-24 15:59:16 +10:00
parent f49fa7b567
commit a1cd80a0f6
8 changed files with 8 additions and 70 deletions

View File

@@ -39,7 +39,7 @@ namespace Umbraco.Tests.Persistence.Repositories
{
Translations = new List<IDictionaryTranslation>
{
new DictionaryTranslation(ServiceContext.LocalizationService.GetLanguageByCultureCode("en-US"), "Hello world")
new DictionaryTranslation(ServiceContext.LocalizationService.GetLanguageByIsoCode("en-US"), "Hello world")
}
};
@@ -70,7 +70,7 @@ namespace Umbraco.Tests.Persistence.Repositories
{
Translations = new List<IDictionaryTranslation>
{
new DictionaryTranslation(ServiceContext.LocalizationService.GetLanguageByCultureCode("en-US"), "Hello world")
new DictionaryTranslation(ServiceContext.LocalizationService.GetLanguageByIsoCode("en-US"), "Hello world")
}
};
@@ -100,7 +100,7 @@ namespace Umbraco.Tests.Persistence.Repositories
{
Translations = new List<IDictionaryTranslation>
{
new DictionaryTranslation(ServiceContext.LocalizationService.GetLanguageByCultureCode("en-US"), "Hello world")
new DictionaryTranslation(ServiceContext.LocalizationService.GetLanguageByIsoCode("en-US"), "Hello world")
}
};
@@ -371,7 +371,7 @@ namespace Umbraco.Tests.Persistence.Repositories
public void CreateTestData()
{
var language = ServiceContext.LocalizationService.GetLanguageByCultureCode("en-US");
var language = ServiceContext.LocalizationService.GetLanguageByIsoCode("en-US");
var languageDK = new Language("da-DK") { CultureName = "da-DK" };
ServiceContext.LocalizationService.Save(languageDK);//Id 2

View File

@@ -76,31 +76,6 @@ namespace Umbraco.Tests.Persistence.Repositories
}
}
[Test]
public void Can_Perform_Get_By_Culture_Name_On_LanguageRepository()
{
var provider = TestObjects.GetScopeProvider(Logger);
using (var scope = provider.CreateScope())
{
var repository = CreateRepository(provider);
var au = CultureInfo.GetCultureInfo("en-AU");
var language = (ILanguage)new Language(au.Name)
{
CultureName = au.DisplayName
};
repository.Save(language);
//re-get
language = repository.GetByCultureName(au.DisplayName);
// Assert
Assert.That(language, Is.Not.Null);
Assert.That(language.HasIdentity, Is.True);
Assert.That(language.CultureName, Is.EqualTo(au.DisplayName));
Assert.That(language.IsoCode, Is.EqualTo(au.Name));
}
}
[Test]
public void Get_When_Id_Doesnt_Exist_Returns_Null()

View File

@@ -144,16 +144,7 @@ namespace Umbraco.Tests.Services
//there's a call or two to get languages, so apart from that there should only be one call per level
Assert.Less(scope.Database.AsUmbracoDatabase().SqlCount, 30);
}
}
[Test]
public void Can_Get_Language_By_Culture_Code()
{
var danish = ServiceContext.LocalizationService.GetLanguageByCultureCode("Danish");
var english = ServiceContext.LocalizationService.GetLanguageByCultureCode("English");
Assert.NotNull(danish);
Assert.NotNull(english);
}
}
[Test]
public void Can_GetLanguageById()