예제 #1
0
        public void TestSaveImageToComputerFormatBMP()
        {
            //Substitute for ManagerInputOutput
            InterfaceOutput outputInterface = Substitute.For <ManagerInputOutput>();

            Bitmap originalBitmapToTest = RetrieveImage.RetrieveImageFromPath("egyptBMP.bmp");

            //Name the to be saved image "TestBPM.bmp"
            outputInterface.SaveImage(originalBitmapToTest);

            Bitmap savedBitmap = RetrieveImage.RetrieveImageFromPath("TestBMP.bmp");

            Assert.IsTrue(RetrieveImage.Equals(originalBitmapToTest, savedBitmap));
        }
예제 #2
0
 //Save button only if filter and edge applied
 private void SaveButton_Click(object sender, EventArgs e)
 {
     if (!edgeIsApplied)
     {
         MessageBox.Show("Please add a filter and an edge!");
     }
     else
     {
         //save picture
         MessageBox.Show("If you cancel, your image will be reset anyways!");
         output.SaveImage(resultBitmap);
         ResetImageToOriginal();
     }
 }