Пример #1
0
        public static void MyClassInitialize(TestContext testContext)
        {
            MSE testMSE = new MSE();
            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;
        }
Пример #2
0
 public void typeTest()
 {
     MSE target = new MSE();
     PluginType expected = PluginType.IMetricOqat;
     PluginType actual;
     target.type = expected;
     actual = target.type;
     Assert.AreEqual(expected, actual);
 }
Пример #3
0
        public void setMementoTest1()
        {
            MSE target = new MSE();
            Memento memento = null;

            target.setMemento(memento);
        }
Пример #4
0
 public void setMementoTest_notInt()
 {
     MSE target = new MSE();
     List<Memento> memList = new List<Memento>();
     Memento memento = new Memento("MEMLIST", memList);
     target.setMemento(memento);
 }
Пример #5
0
 public void namePluginTest()
 {
     MSE target = new MSE();
     string expected = "MSE";
     string actual;
     target.namePlugin = expected;
     actual = target.namePlugin;
     Assert.AreEqual(expected, actual);
 }
Пример #6
0
 public void propertyViewTest()
 {
     MSE target = new MSE();
     UserControl actual;
     actual = target.propertyView;
 }
Пример #7
0
 public void MSEConstructorTest()
 {
     MSE target = new MSE();
     Assert.IsTrue(target is MSE, "The returned object is not a valid MSE instance.");
 }
Пример #8
0
 public void getMementoTest()
 {
     MSE target = new MSE();
     Memento expected = new Memento("MSE", 0);
     Memento actual;
     actual = target.getMemento();
     Assert.AreEqual(expected.state, actual.state);
     Assert.AreEqual(expected.name, actual.name);
 }
Пример #9
0
 public void analyseTest_null()
 {
     MSE target = new MSE();
     Bitmap frameRef = null;
     Bitmap frameProc = null;
     AnalysisInfo actual;
     actual = target.analyse(frameRef, frameProc);
     Assert.IsNull(actual, "analyse can not handle null.");
 }
Пример #10
0
 public void analyseTest_empty()
 {
     MSE target = new MSE();
     Bitmap frameRef = new Bitmap(15, 15);
     Bitmap frameProc = new Bitmap(15, 15);
     AnalysisInfo actual;
     actual = target.analyse(frameRef, frameProc);
     Assert.IsTrue(actual is AnalysisInfo, "analyse can not handle empty Bitmaps.");
 }
Пример #11
0
        public void analyseTest()
        {
            MSE target = new MSE();
            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]);
            }
        }