private bool FillsAreEqual(Fill f, IXLFill xlFill) { var nF = new XLFill(); if (f.PatternFill != null) { if (f.PatternFill.PatternType != null) nF.PatternType = f.PatternFill.PatternType.Value.ToClosedXml(); var fColor = GetColor(f.PatternFill.ForegroundColor); if (fColor.HasValue) nF.PatternColor = fColor; var bColor = GetColor(f.PatternFill.BackgroundColor); if (bColor.HasValue) nF.PatternBackgroundColor = bColor; } return nF.Equals(xlFill); }
public void BackgroundPatternNotEqualCheck() { var fill1 = new XLFill {PatternBackgroundColor = XLColor.Blue}; var fill2 = new XLFill {PatternBackgroundColor = XLColor.Red}; Assert.IsFalse(fill1.Equals(fill2)); }