Esempio n. 1
0
        public void OverlayedSize()
        {
            var imgProvider = _moq.GetImageProviderMock().Object;
            var overlay     = _moq.GetOverlayMock().Object;

            using var provider = new OverlayedImageProvider(imgProvider, overlay);
            Assert.Equal(provider.Width, imgProvider.Width);
            Assert.Equal(provider.Height, imgProvider.Height);

            using var img = provider.Capture();
            Assert.Equal(provider.Width, img.Width);
            Assert.Equal(provider.Height, img.Height);
        }
        public void CaptureOverlayedImage()
        {
            var imgProviderMock = _moq.GetImageProviderMock();
            var overlayMock     = _moq.GetOverlayMock();

            using (var provider = new OverlayedImageProvider(imgProviderMock.Object, overlayMock.Object))
            {
                using (provider.Capture())
                {
                    imgProviderMock.Verify(M => M.Capture(), Times.Once);
                    overlayMock.Verify(M => M.Draw(It.IsAny <IEditableFrame>(), It.IsAny <Func <Point, Point> >()), Times.Once);
                }
            }

            imgProviderMock.Verify(M => M.Dispose(), Times.Once);
            overlayMock.Verify(M => M.Dispose(), Times.Once);
        }
Esempio n. 3
0
        public void OverlayedSize()
        {
            var imgProvider = MoqFactory.GetImageProviderMock().Object;
            var overlay     = MoqFactory.GetOverlayMock().Object;

            using (var provider = new OverlayedImageProvider(imgProvider, P => P, overlay))
            {
                Assert.AreEqual(provider.Width, imgProvider.Width);
                Assert.AreEqual(provider.Height, imgProvider.Height);

                using (var img = provider.Capture())
                {
                    Assert.AreEqual(provider.Width, img.Width);
                    Assert.AreEqual(provider.Height, img.Height);
                }
            }
        }
Esempio n. 4
0
        public void CaptureOverlayedImage()
        {
            var imgProviderMock = MoqFactory.GetImageProviderMock();
            var overlayMock     = MoqFactory.GetOverlayMock();

            using (var provider = new OverlayedImageProvider(imgProviderMock.Object, P => P, overlayMock.Object))
            {
                using (provider.Capture())
                {
                    imgProviderMock.Verify(M => M.Capture(), Times.Once);
                    overlayMock.Verify(M => M.Draw(It.IsAny <Graphics>(), It.IsAny <Func <Point, Point> >()), Times.Once);
                }
            }

            imgProviderMock.Verify(M => M.Dispose(), Times.Once);
            overlayMock.Verify(M => M.Dispose(), Times.Once);
        }
Esempio n. 5
0
        public void OverlayedSize()
        {
            var imgProvider = ServiceProvider.Get <IImageProvider>();
            var overlay     = ServiceProvider.Get <IOverlay>();

            using (var provider = new OverlayedImageProvider(imgProvider, P => P, overlay))
            {
                Assert.AreEqual(provider.Width, imgProvider.Width);
                Assert.AreEqual(provider.Height, imgProvider.Height);

                using (var img = provider.Capture())
                {
                    if (img.Bitmap != null)
                    {
                        Assert.AreEqual(provider.Width, img.Bitmap.Width);
                        Assert.AreEqual(provider.Height, img.Bitmap.Height);
                    }
                }
            }
        }