Пример #1
0
        public void Position_XTest()
        {
            PositionStyle target = new PositionStyle();

            // Default value

            PDFUnit expected = PDFUnit.Empty;
            PDFUnit actual   = target.X;

            Assert.AreEqual(expected, actual);

            // Set Value

            expected = 20;
            target.X = expected;
            actual   = target.X;
            Assert.AreEqual(expected, actual);

            // Change Value

            expected = new PDFUnit(120, PageUnits.Millimeters);
            target.X = expected;
            actual   = target.X;
            Assert.AreEqual(expected, actual);

            // Remove Value

            expected = PDFUnit.Empty;
            target.RemoveX();
            actual = target.X;
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void Position_PositionModeTest()
        {
            PositionStyle target = new PositionStyle();

            //Default

            PositionMode expected = PositionMode.Block;

            Assert.AreEqual(expected, target.PositionMode);

            //Set value

            expected = PositionMode.Absolute;
            PositionMode actual;

            target.PositionMode = expected;
            actual = target.PositionMode;
            Assert.AreEqual(expected, actual);

            // Change Value

            expected            = PositionMode.Relative;
            target.PositionMode = expected;
            actual = target.PositionMode;
            Assert.AreEqual(expected, actual);

            //Remove value

            expected = PositionMode.Block;
            target.RemovePositionMode();
            actual = target.PositionMode;
            Assert.AreEqual(expected, actual);

            // Check the X or Y setting to relative

            expected = PositionMode.Relative;
            target   = new PositionStyle();
            target.X = 20;
            actual   = target.PositionMode;
            Assert.AreEqual(expected, actual);

            target.RemoveX();
            target.Y = 40;
            actual   = target.PositionMode;
            Assert.AreEqual(expected, actual);

            //set both
            target.X = 50;
            actual   = target.PositionMode;
            Assert.AreEqual(expected, actual);

            //explicit override even if X or Y is set
            expected            = PositionMode.Absolute;
            target.PositionMode = expected;
            actual = target.PositionMode;
            Assert.AreEqual(expected, actual);
        }