private void UpdateLongStringSettings(PageDefinition pageDefinition, PageTypePropertyAttribute propertyAttribute) { EditorToolOption longStringSettings = propertyAttribute.LongStringSettings; if (longStringSettings == default(EditorToolOption) && !propertyAttribute.ClearAllLongStringSettings) { longStringSettings = EditorToolOption.All; } pageDefinition.LongStringSettings = longStringSettings; }
public void GivePropertyDefinition_UpdatePageDefinitionValues_UpdatesPageDefinitionLongStringSettings( EditorToolOption longStringSettings) { PageTypePropertyUpdater pageTypePropertyUpdater = CreatePageTypePropertyUpdaterWithFakeUpdatePageDefinitionTabMethod(); PageDefinition pageDefinitionToUpdate = new PageDefinition(); PageTypePropertyDefinition propertyDefinition = CreatePageTypePropertyDefinition(); propertyDefinition.PageTypePropertyAttribute.LongStringSettings = longStringSettings; pageTypePropertyUpdater.UpdatePageDefinitionValues(pageDefinitionToUpdate, propertyDefinition); Assert.Equal <EditorToolOption>( propertyDefinition.PageTypePropertyAttribute.LongStringSettings, pageDefinitionToUpdate.LongStringSettings); }
public void GivePropertyDefinitionWithLongStringSettingsAndClearAllLongStringSettings_UpdatePageDefinitionValues_SetsPageDefinitionLongStringSettings( EditorToolOption longStringSettings) { PageTypePropertyUpdater pageTypePropertyUpdater = CreatePageTypePropertyUpdaterWithFakeUpdatePageDefinitionTabMethod(); PageDefinition pageDefinitionToUpdate = new PageDefinition(); PageTypePropertyDefinition propertyDefinition = CreatePageTypePropertyDefinition(); propertyDefinition.PageTypePropertyAttribute.LongStringSettings = longStringSettings; propertyDefinition.PageTypePropertyAttribute.ClearAllLongStringSettings = true; pageTypePropertyUpdater.UpdatePageDefinitionValues(pageDefinitionToUpdate, propertyDefinition); Assert.Equal<EditorToolOption>( propertyDefinition.PageTypePropertyAttribute.LongStringSettings, pageDefinitionToUpdate.LongStringSettings); }