Esempio n. 1
0
        public static void MyClassInitialize(TestContext testContext)
        {
            PSNR testMSE = new PSNR();
            refBitmap = new Bitmap(100, 100);
            for (int height = 0; height < refBitmap.Height; height++)
            {
                for (int width = 0; width < refBitmap.Width; width++)
                {
                    refBitmap.SetPixel(width, height, Color.White);
                    width++;
                    refBitmap.SetPixel(width, height, Color.Black);
                    width++;
                    refBitmap.SetPixel(width, height, Color.Red);
                    width++;
                    refBitmap.SetPixel(width, height, Color.Green);
                    width++;
                    refBitmap.SetPixel(width, height, Color.Blue);
                }
            }

            procBitmap = new Bitmap(100, 100);
            for (int width = 0; width < refBitmap.Width; width++)
            {
                for (int height = 0; height < procBitmap.Height; height++)
                {
                    procBitmap.SetPixel(width, height, Color.White);
                    height++;
                    procBitmap.SetPixel(width, height, Color.Black);
                    height++;
                    procBitmap.SetPixel(width, height, Color.Red);
                    height++;
                    procBitmap.SetPixel(width, height, Color.Green);
                    height++;
                    procBitmap.SetPixel(width, height, Color.Blue);
                }
            }
            analysisInfo = testMSE.analyse(refBitmap, procBitmap);
            analysedBitmap = analysisInfo.frame;
        }
Esempio n. 2
0
 public void typeTest()
 {
     PSNR target = new PSNR();
     PluginType expected = PluginType.IMetricOqat;
     PluginType actual;
     target.type = expected;
     actual = target.type;
     Assert.AreEqual(expected, actual);
 }
Esempio n. 3
0
 public void PSNRConstructorTest()
 {
     PSNR target = new PSNR();
     Assert.IsTrue(target is PSNR, "The returned object is not a valid PSNR instance.");
 }
Esempio n. 4
0
 public void propertyViewTest()
 {
     PSNR target = new PSNR();
     UserControl actual;
     actual = target.propertyView;
 }
Esempio n. 5
0
 public void namePluginTest()
 {
     PSNR target = new PSNR();
     string expected = "PSNR";
     string actual;
     target.namePlugin = expected;
     actual = target.namePlugin;
     Assert.AreEqual(expected, actual);
 }
Esempio n. 6
0
 public void getMementoTest()
 {
     PSNR target = new PSNR();
     Memento expected = new Memento("testMemento", target);
     Memento actual;
     actual = target.getMemento();
     Assert.AreEqual(expected.state, actual.state);
 }
Esempio n. 7
0
        public void analyseTest()
        {
            PSNR target = new PSNR();
            Bitmap frameRef = refBitmap;
            Bitmap frameProc = procBitmap;
            AnalysisInfo expected = analysisInfo;
            AnalysisInfo actual;
            actual = target.analyse(frameRef, frameProc);

            //Check every Pixel
            for (int height = 0; height < expected.frame.Height; height++)
            {
                for (int width = 0; width < expected.frame.Width; width++)
                {
                    Assert.AreEqual(expected.frame.GetPixel(height, width), actual.frame.GetPixel(height, width), "Analyse is working randomly");
                }
            }
            //Check Values
            for (int floats = 0; floats < expected.values.GetLength(0); floats++)
            {
                Assert.AreEqual(expected.values[floats], actual.values[floats]);
            }
        }