Fix test due to various changes
This commit is contained in:
@@ -246,7 +246,10 @@ namespace Umbraco.Tests.Models.Mapping
|
||||
[Test]
|
||||
public void PropertyGroupBasic_To_PropertyGroup()
|
||||
{
|
||||
var basic = new PropertyGroupBasic<PropertyTypeBasic>()
|
||||
_dataTypeService.Setup(x => x.GetDataTypeDefinitionById(It.IsAny<int>()))
|
||||
.Returns(new DataTypeDefinition("test"));
|
||||
|
||||
var basic = new PropertyGroupBasic<PropertyTypeBasic>
|
||||
{
|
||||
Id = 222,
|
||||
Name = "Group 1",
|
||||
@@ -286,7 +289,19 @@ namespace Umbraco.Tests.Models.Mapping
|
||||
}
|
||||
};
|
||||
|
||||
var result = Mapper.Map<PropertyGroup>(basic);
|
||||
var contentType = new ContentTypeSave
|
||||
{
|
||||
Id = 0,
|
||||
ParentId = -1,
|
||||
Alias = "alias",
|
||||
AllowedTemplates = Enumerable.Empty<string>(),
|
||||
Groups = new[] { basic }
|
||||
};
|
||||
|
||||
// proper group properties mapping takes place when mapping the content type,
|
||||
// not when mapping the group - because of inherited properties and such
|
||||
//var result = Mapper.Map<PropertyGroup>(basic);
|
||||
var result = Mapper.Map<IContentType>(contentType).PropertyGroups[0];
|
||||
|
||||
Assert.AreEqual(basic.Name, result.Name);
|
||||
Assert.AreEqual(basic.Id, result.Id);
|
||||
|
||||
@@ -986,7 +986,9 @@ namespace Umbraco.Tests.Services
|
||||
Assert.That(contentType, Is.Not.Null);
|
||||
|
||||
var compositionPropertyGroups = contentType.CompositionPropertyGroups;
|
||||
Assert.That(compositionPropertyGroups.Count(x => x.Name.Equals("Content_")), Is.EqualTo(0));
|
||||
|
||||
// now it is still 1, because we don't propagate renames anymore
|
||||
Assert.That(compositionPropertyGroups.Count(x => x.Name.Equals("Content_")), Is.EqualTo(1));
|
||||
|
||||
var propertyTypeCount = contentType.PropertyTypes.Count();
|
||||
var compPropertyTypeCount = contentType.CompositionPropertyTypes.Count();
|
||||
@@ -1059,7 +1061,9 @@ namespace Umbraco.Tests.Services
|
||||
|
||||
var advancedPageReloaded = service.GetContentType("advancedPage");
|
||||
var contentUnderscoreTabExists = advancedPageReloaded.CompositionPropertyGroups.Any(x => x.Name.Equals("Content_"));
|
||||
Assert.That(contentUnderscoreTabExists, Is.False);
|
||||
|
||||
// now is true, because we don't propagate renames anymore
|
||||
Assert.That(contentUnderscoreTabExists, Is.True);
|
||||
|
||||
var numberOfContentTabs = advancedPageReloaded.CompositionPropertyGroups.Count(x => x.Name.Equals("Content"));
|
||||
Assert.That(numberOfContentTabs, Is.EqualTo(4));
|
||||
|
||||
Reference in New Issue
Block a user