public void GetHeightForBody_IsTotalPageHeight_IfNoAdditionalPrintParts()
        {
            PrintDimension pd = new PrintDimension();
            pd.InternalPrintDefinition = new PrintDefinition();

            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(0));

            pd.PageSize = new Size(100, 300);

            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(300));

            pd.Margin = new Thickness(10);

            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(280));
        }
        public void GetHeightForBody_IsTotalPageHeightMinusPrintParts()
        {
            Mock <IPrintProcessor> mock = new Mock <IPrintProcessor>();

            mock.Setup(i => i.GetHeader()).Returns(new Grid {
                Height = 10
            });
            mock.Setup(i => i.GetFooter()).Returns(new Grid {
                Height = 20
            });
            mock.Setup(i => i.GetHeaderDescription()).Returns(new Grid {
                Height = 30
            });
            mock.Setup(i => i.GetSummary()).Returns(new Grid {
                Height = 40
            });
            mock.Setup(i => i.GetPageNumbers(It.IsAny <int>(), It.IsAny <int>())).Returns(new Grid {
                Height = 25
            });

            PrintDimension pd = new PrintDimension
            {
                PrintProcessor          = mock.Object,
                InternalPrintDefinition = new PrintDefinition()
            };

            pd.InternalPrintDefinition.SetPrintAttribute(new PrintOnAllPagesAttribute(PrintAppendixes.All));

            pd.PageSize = new Size(100, 300);

            // 300 - Header - Footer - HeaderDescritpion - Summary - PageNumbers
            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(175));
        }
        public void GetHeightForBody_IsTotalPageHeight_IfNoAdditionalPrintParts()
        {
            PrintDimension pd = new PrintDimension {
                InternalPrintDefinition = new PrintDefinition()
            };

            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(0));

            pd.PageSize = new Size(100, 300);

            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(300));

            pd.Margin = new Thickness(10);

            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(280));
        }
        public void GetHeightForBody_IsTotalPageHeightMinusPrintParts()
        {
            Mock<IPrintProcessor> mock = new Mock<IPrintProcessor>();
            mock.Setup(i => i.GetHeader()).Returns(new Grid { Height = 10 });
            mock.Setup(i => i.GetFooter()).Returns(new Grid { Height = 20 });
            mock.Setup(i => i.GetHeaderDescription()).Returns(new Grid { Height = 30 });
            mock.Setup(i => i.GetSummary()).Returns(new Grid { Height = 40 });

            PrintDimension pd = new PrintDimension();
            pd.PrintProcessor = mock.Object;
            pd.InternalPrintDefinition = new PrintDefinition();
            pd.InternalPrintDefinition.SetPrintAttribute(new PrintOnAllPagesAttribute(PrintAppendixes.All));

            pd.PageSize = new Size(100, 300);

            // 300 - Header - Footer - HeaderDescritpion - Summary - PageNumbers
            Assert.That(pd.GetHeightForBodyGrid(1, false), Is.EqualTo(175));
        }