Beispiel #1
0
        public void CanEnableSimpleStyle()
        {
            var s = new OutlineStyle(Color.Red, false);

            Assert.AreEqual(s.GetColor(), Color.Transparent);
            Assert.AreEqual(s.GetLineThickness(), 1);
            Assert.IsFalse(s.IsEnabled().Value);

            s.Enable(true);
            Assert.AreEqual(s.GetColor(), Color.Red);
            Assert.IsTrue(s.IsEnabled().Value);
        }
Beispiel #2
0
        public void CanChangeSimpleStyleColor()
        {
            var s = new OutlineStyle(Color.Red, true);

            Assert.AreEqual(s.GetColor(), Color.Red);
            Assert.AreEqual(s.GetLineThickness(), 1);
            Assert.IsTrue(s.IsEnabled().Value);

            s.SetColor(Color.Green);
            Assert.AreEqual(s.GetColor(), Color.Green);
            Assert.IsTrue(s.IsEnabled().Value);
        }
Beispiel #3
0
        public void CanAddShapeInGroupByIndex()
        {
            var slide  = new Slide(500, 500);
            var fStyle = new FillStyle(Color.Red, true);
            var oStyle = new OutlineStyle(Color.Black, true, 2);
            var f      = new Rect <float> {
                Top = 0, Left = 0, Width = 10, Height = 10
            };
            var rect = new Rectangle(f, oStyle, fStyle);

            var group = new Group(rect);

            var f2 = new Rect <float> {
                Top = 5, Left = 5, Width = 10, Height = 10
            };
            var rect2 = new Rectangle(f2, oStyle, fStyle);

            group.InsertShape(rect2, 0);

            Assert.AreEqual(group.GetShapesCount(), 2);
            Assert.AreEqual(oStyle.GetColor(), group.OutlineStyle.GetColor());
            Assert.AreEqual(oStyle.IsEnabled(), group.OutlineStyle.IsEnabled());
            Assert.AreEqual(oStyle.GetLineThickness(), group.OutlineStyle.GetLineThickness());
            Assert.AreEqual(fStyle.GetColor(), group.FillStyle.GetColor());
            Assert.AreEqual(fStyle.IsEnabled(), group.FillStyle.IsEnabled());
            Assert.AreEqual(2, group.OutlineStyle.GetLineThickness());
        }
Beispiel #4
0
        public void CanCreateGroupWithRectangleOnSlide()
        {
            var slide  = new Slide(500, 500);
            var fStyle = new FillStyle(Color.Red, true);
            var oStyle = new OutlineStyle(Color.Black, true);
            var f      = new Rect <float> {
                Top = 1, Left = 1, Width = 10, Height = 10
            };
            var rect = new Rectangle(f, oStyle, fStyle);

            var group = new Group(rect);

            Assert.AreEqual(1, group.OutlineStyle.GetLineThickness());
            Assert.AreEqual(oStyle.GetColor(), group.OutlineStyle.GetColor());
            Assert.AreEqual(oStyle.IsEnabled(), group.OutlineStyle.IsEnabled());
            Assert.AreEqual(oStyle.GetLineThickness(), group.OutlineStyle.GetLineThickness());
            Assert.AreEqual(fStyle.GetColor(), group.FillStyle.GetColor());
            Assert.AreEqual(fStyle.IsEnabled(), group.FillStyle.IsEnabled());

            slide.InsertShape(group, 0);

            Assert.AreEqual(1, slide.ShapeCount);
            Assert.AreEqual(rect.OutlineStyle.GetColor(), group.OutlineStyle.GetColor());
            Assert.AreEqual(rect.OutlineStyle.IsEnabled(), group.OutlineStyle.IsEnabled());
            Assert.AreEqual(rect.OutlineStyle.GetLineThickness(), group.OutlineStyle.GetLineThickness());
            Assert.AreEqual(rect.FillStyle.GetColor(), group.FillStyle.GetColor());
            Assert.AreEqual(rect.FillStyle.IsEnabled(), group.FillStyle.IsEnabled());
        }
Beispiel #5
0
        public void CanCreateSimpleOutlineStyleWithDisableStyleAndReturnTransparentColor()
        {
            var s = new OutlineStyle(Color.Red, false);

            Assert.AreEqual(s.GetColor(), Color.Transparent);
            Assert.AreEqual(s.GetLineThickness(), 1);
            Assert.IsFalse(s.IsEnabled().Value);
        }
Beispiel #6
0
        public void CanCreateSimpleOutlineStyleWithLineThickness1ByDefault()
        {
            var s = new OutlineStyle(Color.Red, true);

            Assert.AreEqual(s.GetColor(), Color.Red);
            Assert.AreEqual(s.GetLineThickness(), 1);
            Assert.IsTrue(s.IsEnabled().Value);
        }