Add failing test - dictionary items don't get properly nested
This commit is contained in:
@@ -402,6 +402,32 @@ namespace Umbraco.Tests.Services.Importing
|
||||
AssertDictionaryItem("Child", expectedNorwegianChildValue, "nb-NO");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PackagingService_Can_Import_Nested_DictionaryItems()
|
||||
{
|
||||
// Arrange
|
||||
const string parentKey = "Parent";
|
||||
const string childKey = "Child";
|
||||
|
||||
var newPackageXml = XElement.Parse(ImportResources.Dictionary_Package);
|
||||
var dictionaryItemsElement = newPackageXml.Elements("DictionaryItems").First();
|
||||
|
||||
AddLanguages();
|
||||
|
||||
// Act
|
||||
ServiceContext.PackagingService.ImportDictionaryItems(dictionaryItemsElement);
|
||||
|
||||
// Assert
|
||||
Assert.That(ServiceContext.LocalizationService.DictionaryItemExists(parentKey), "DictionaryItem parentKey does not exist");
|
||||
Assert.That(ServiceContext.LocalizationService.DictionaryItemExists(childKey), "DictionaryItem childKey does not exist");
|
||||
|
||||
var parentDictionaryItem = ServiceContext.LocalizationService.GetDictionaryItemByKey(parentKey);
|
||||
var childDictionaryItem = ServiceContext.LocalizationService.GetDictionaryItemByKey(childKey);
|
||||
|
||||
Assert.That(parentDictionaryItem.ParentId, Is.Not.EqualTo(childDictionaryItem.ParentId));
|
||||
Assert.That(childDictionaryItem.ParentId, Is.EqualTo(parentDictionaryItem.Id));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PackagingService_WhenExistingDictionaryKey_ImportsNewChildren()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user