public void VerticalAlignment_CanGetSet() { var overlay = new CaptionOverlay(); Assert.AreEqual(VerticalAlignment.Top, overlay.VerticalAlignment); overlay.VerticalAlignment = VerticalAlignment.Bottom; Assert.AreEqual(VerticalAlignment.Bottom, overlay.VerticalAlignment); }
public void HorizontalAlignment_CanGetSet() { var overlay = new CaptionOverlay(); Assert.AreEqual(HorizontalAlignment.Left, overlay.HorizontalAlignment); overlay.HorizontalAlignment = HorizontalAlignment.Center; Assert.AreEqual(HorizontalAlignment.Center, overlay.HorizontalAlignment); }
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); }
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); }
public void AddOverlay_WhenOverlayIsValid_AddsTheOverlayToTheOverlayManager() { var overlay = new CaptionOverlay(); Capture.AddOverlay(overlay); Assert.Contains(Capture.GetOverlayManager().Overlays, overlay); }
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); } }