Exemplo n.º 1
0
        public void TwoInstancesOfCellStyleAreEqual()
        {
            Assert.AreEqualAndHaveSameHash(new CellStyle(), new CellStyle());

            Assert.AreEqualAndHaveSameHash(new BorderEdge()
            {
                Style = BorderStyle.DashDot
            }, new BorderEdge()
            {
                Style = BorderStyle.DashDot
            });
            Assert.AreEqualAndHaveSameHash(new Color(1, 2, 3, 4), new Color(1, 2, 3, 4));
            Assert.AreEqualAndHaveSameHash(new CellFont {
                Name = "T", Size = 10
            }, new CellFont {
                Name = "T", Size = 10
            });

            var c1 = new CellStyle
            {
                Alignment = new CellAlignment {
                    HAlign = HorizontalAlignment.Center, Indent = 2
                },
                Border = new CellBorder {
                    Bottom = new BorderEdge {
                        Color = new Color(1, 2, 3, 4), Style = BorderStyle.DashDot
                    }
                },
                Fill = new CellFill {
                    Background = new Color(2, 3, 4, 5), Pattern = FillPattern.Solid
                },
                Font = new CellFont {
                    Bold = true, Name = "Tahoma"
                },
                Format = "{0}"
            };

            var c2 = new CellStyle
            {
                Alignment = new CellAlignment {
                    HAlign = HorizontalAlignment.Center, Indent = 2
                },
                Border = new CellBorder {
                    Bottom = new BorderEdge {
                        Color = new Color(1, 2, 3, 4), Style = BorderStyle.DashDot
                    }
                },
                Fill = new CellFill {
                    Background = new Color(2, 3, 4, 5), Pattern = FillPattern.Solid
                },
                Font = new CellFont {
                    Bold = true, Name = "Tahoma"
                },
                Format = "{0}"
            };
        }