Add failing test - dictionary items don't get properly nested

This commit is contained in:
Sebastiaan Janssen
2014-05-01 12:26:18 +02:00
parent e858f4ff1e
commit caf41b74b8

View File

@@ -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()
{