public ITagPair CreateTag(IFormattingItem item = null) { var tagPair = Substitute.For <ITagPair>(); tagPair.StartTagProperties = Substitute.For <IStartTagProperties>(); var formatting = Substitute.For <IFormattingGroup>(); formatting.Values.Returns(new List <IFormattingItem>() { item }); tagPair.StartTagProperties.Formatting = formatting; return(tagPair); }
private static IStartTagProperties CreateStartTagProperties(IPropertiesFactory propertyFactory, IFormattingItemFactory formattingFactory, IFormattingItem formattingItem, int tagId, string colorName) { var startTagProperties = propertyFactory.CreateStartTagProperties("<cf highlight=" + colorName + ">"); if (startTagProperties.Formatting == null) { startTagProperties.Formatting = formattingFactory.CreateFormatting(); } startTagProperties.Formatting.Add(formattingItem); startTagProperties.TagId = new TagId(tagId.ToString()); startTagProperties.CanHide = true; startTagProperties.DisplayText = "cf"; startTagProperties.SetMetaData(CadfBackgroundColorKey, "True"); foreach (var keyPair in GetBackgroundColorMetaData(colorName)) { startTagProperties.SetMetaData(keyPair.Key, keyPair.Value); } return(startTagProperties); }