public void BlankLine_HeightValid([Random(1, 100, 1)] int height)
        {
            var content = PrintContent.BlankLine(height).Content;

            content.Measure(new Size(double.MaxValue, double.MaxValue));

            Assert.That(content.DesiredSize.Height, Is.EqualTo(height));
        }
        public void Combine()
        {
            var content1 = PrintContent.BlankLine(10);
            var content2 = PrintContent.BlankLine(10);

            var combined = PrintContent.Combine(content1, content2).Content;

            combined.Measure(new Size(double.MaxValue, double.MaxValue));

            Assert.That(combined.DesiredSize.Height, Is.EqualTo(20));
        }
Exemple #3
0
        public override IEnumerable <IPrintContent> ItemCollection()
        {
            yield return(PrintContent.TextLine("Test", 10));

            yield return(PrintContent.BlankLine(50));

            yield return(PrintContent.PageBreak());

            yield return(PrintContent.BlankLine(50));

            yield return(PrintContent.BlankLine(90));

            yield return(new DirectPrintContent {
                Content = new TextBlock {
                    Background = Brushes.Red
                }
            });

            yield return(PrintContent.BlankLine(100));
        }
 public void BlankLine_HeightNegative_ThrowsArgumentOutOfRangeException()
 {
     Assert.That(() => PrintContent.BlankLine(0), Throws.InstanceOf <ArgumentOutOfRangeException>());
     Assert.That(() => PrintContent.BlankLine(-1), Throws.InstanceOf <ArgumentOutOfRangeException>());
 }