Exemplo n.º 1
0
        public void TopLeftWithCaption()
        {
            Bitmap captionedImage;

            // create the mocked services
            var logService = new Mock <Services.ILogService>().Object;

            // create the image service
            var imageService = new Services.ImageService(
                new Services.ImageLoaderService(logService),
                new Services.LineWrapService(logService),
                logService);

            // create a new test image
            using (var testImage = new Bitmap(480, 640, PixelFormat.Format24bppRgb))
            {
                // add the caption
                captionedImage = imageService.Caption(testImage, "This is a test caption", Services.CaptionAlignments.TopLeft, "Arial", 10f, "%", true, new SolidBrush(Color.White), Color.FromArgb(127, 255, 255, 255), new CancellationToken()) as Bitmap;
            }

            // load the expected result
            var expectedImage = Properties.Resources.TopLeftWithCaption;

            // is it the expected result?
            var equal = ImageUtilities.AreEqual(captionedImage, expectedImage);

            Assert.AreEqual(true, equal);
        }
Exemplo n.º 2
0
 public HomeController(NLog.Logger logger, Data data, Services.ImageService imageService)
 {
     _logger            = logger;
     _data              = data;
     this._imageService = imageService;
 }
Exemplo n.º 3
0
 public GalleryController(NLog.Logger logger, Data data, Services.ImageService imageService)
 {
     this._logger       = logger;
     this._data         = data;
     this._imageService = imageService;
 }