Ejemplo n.º 1
0
        public void VerticalAlignment_CanGetSet()
        {
            var overlay = new CaptionOverlay();

            Assert.AreEqual(VerticalAlignment.Top, overlay.VerticalAlignment);

            overlay.VerticalAlignment = VerticalAlignment.Bottom;
            Assert.AreEqual(VerticalAlignment.Bottom, overlay.VerticalAlignment);
        }
Ejemplo n.º 2
0
        public void HorizontalAlignment_CanGetSet()
        {
            var overlay = new CaptionOverlay();

            Assert.AreEqual(HorizontalAlignment.Left, overlay.HorizontalAlignment);

            overlay.HorizontalAlignment = HorizontalAlignment.Center;
            Assert.AreEqual(HorizontalAlignment.Center, overlay.HorizontalAlignment);
        }
Ejemplo n.º 3
0
        public void Text_CanGetSet()
        {
            var overlay = new CaptionOverlay();

            Assert.AreEqual("", overlay.Text);

            overlay.Text = "New value";
            Assert.AreEqual("New value", overlay.Text);

            Assert.Throws<ArgumentNullException>(() => overlay.Text = null);
        }
Ejemplo n.º 4
0
        public void FontSize_CanGetSet()
        {
            var overlay = new CaptionOverlay();

            Assert.AreEqual(16, overlay.FontSize);

            overlay.FontSize = 12;
            Assert.AreEqual(12, overlay.FontSize);

            Assert.Throws<ArgumentOutOfRangeException>(() => overlay.FontSize = 0);
            Assert.Throws<ArgumentOutOfRangeException>(() => overlay.FontSize = -1);
        }
Ejemplo n.º 5
0
        public void AddOverlay_WhenOverlayIsValid_AddsTheOverlayToTheOverlayManager()
        {
            var overlay = new CaptionOverlay();

            Capture.AddOverlay(overlay);

            Assert.Contains(Capture.GetOverlayManager().Overlays, overlay);
        }
Ejemplo n.º 6
0
        public void Paint()
        {
            var overlayManager = new OverlayManager();
            var overlay = new CaptionOverlay()
            {
                Text = "This is some text.",
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Bottom
            };
            overlayManager.AddOverlay(overlay);

            using (Bitmap bitmap = CreateBitmapWithBackground())
            {
                overlayManager.PaintOverlaysOnImage(bitmap, 0, 0);

                TestLog.WriteLine("Image should contain 'This is some text.' centered at the bottom.");
                TestLog.EmbedImage("Image", bitmap);
            }
        }