using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CSTiffImageConverter;

namespace TestCSTiffImageConverter
{
    [TestClass]
    public class TestResize
    {
        // Test if the file name is empty.
        [TestMethod]
        public void TestFileNameEmpty()
        {
            int actualResult = TiffImageConverter.ResizeImage("");
            int expectedResult = -1;
            Assert.AreEqual(expectedResult, actualResult);
        }

        // Test if the file does not exist.
        [TestMethod]
        public void TestFileNotExist()
        {
            int actualResult = TiffImageConverter.ResizeImage("C:\asdf.png");
            int expectedResult = -2;
            Assert.AreEqual(expectedResult, actualResult);
        }

        /**
         * Before executing this test, be sure that the path for the image is correct
         * and that the image exists.
         */
        // Test if the file is already at the good size
        [TestMethod]
        public void TestSize()
        {
            int actualResult = TiffImageConverter.ResizeImage("C:\\Users\\uadmin\\Documents\\Visual Studio 2013\\Projects\\GaspozRudaz_TiffImageConverter\\C#\\Debug\\sample0_resized.Jpeg");
            int expectedResult = 0;
            Assert.AreEqual(expectedResult, actualResult);
        }

        /**
         * Before executing this test, be sure that the path for the image is correct
         * and that the image exists and that the file "sample0_resized.Bmp" does not exist.
         * Otherwise the test will pass if it is run alone.
         */
        // Test when everything is ok.
        [TestMethod]
        public void TestResizeOk()
        {
            int actualResult = TiffImageConverter.ResizeImage("C:\\Users\\uadmin\\Documents\\Visual Studio 2013\\Projects\\GaspozRudaz_TiffImageConverter\\C#\\Debug\\sample0.Bmp");
            int expectedResult = 1;
            Assert.AreEqual(expectedResult, actualResult);
        }
    }
}
