Exemplo n.º 1
0
 //Method to save the image
 public void saveImageInDirectory(string fileName, Bitmap bitmapToSave)
 {
     try
     {
         savedBitmap = imageInterface.saveImage(fileName, bitmapToSave);
     }
     catch (Exception e)
     {
         outputFileException = true;
         Console.WriteLine(e.Message);
     }
 }
        public void OutputFileMethod()
        {
            Bitmap bitmap = new Bitmap(300, 300);
            BusinessLayer business = new BusinessLayer(imageInterface, filterInterface, edgeDetectionInterface);
            imageInterface.saveImage("TestMethod_UnitTest", bitmap).Returns<Bitmap>(bitmap);
            business.saveImageInDirectory("TestMethod_UnitTest", bitmap);

            Size bitmapSize = business.getSavedImage().Size;
            Size expectedSize = new Size(300, 300);

            Assert.AreEqual(expectedSize, bitmapSize);
        }