Example #1
0
 public static void MyClassInitialize(TestContext testContext)
 {
     NoiseGenerator noiGen = new NoiseGenerator();
     original = noiGen.getMemento();
     testBitmap = new Bitmap(testPixel, testPixel);
     for (int height = 0; height < testBitmap.Height; height++)
     {
         for (int width = 0; width < testBitmap.Width; width++)
         {
             testBitmap.SetPixel(width, height, Color.White);
             width++;
             testBitmap.SetPixel(width, height, Color.Black);
             width++;
             testBitmap.SetPixel(width, height, Color.Red);
             width++;
             testBitmap.SetPixel(width, height, Color.Green);
             width++;
             testBitmap.SetPixel(width, height, Color.Blue);
         }
     }
     testNoise = new Memento("test", 5.1F);
 }
Example #2
0
 public void getMementoTest()
 {
     NoiseGenerator target = new NoiseGenerator();
     Memento expected = original;
     Memento actual;
     actual = target.getMemento();
     float expectedMean = (float)expected.state;
     float actualMean = (float)actual.state;
     Assert.AreEqual(expectedMean, actualMean);
 }
Example #3
0
 public void typeTest()
 {
     NoiseGenerator target = new NoiseGenerator();
     PluginType expected = PluginType.IFilterOqat;
     PluginType actual;
     target.type = expected;
     actual = target.type;
     Assert.AreEqual(expected, actual);
 }
Example #4
0
 public void setMementoTest()
 {
     NoiseGenerator target = new NoiseGenerator();
     Memento memento = testNoise;
     target.setMemento(memento);
     float actualMean = (float)target.getMemento().state;
     float expectedMean = (float)memento.state;
     Assert.AreEqual(expectedMean, actualMean, "Memento was not set right. ");
 }
Example #5
0
 public void propertyViewTest()
 {
     NoiseGenerator target = new NoiseGenerator();
     UserControl actual;
     actual = target.propertyView;
 }
Example #6
0
 public void processTest()
 {
     NoiseGenerator target = new NoiseGenerator();
     Bitmap frame = testBitmap;
     float expectedMean = (float)target.getMemento().state;
     Bitmap actual;
     actual = target.process(frame);
     float actualMean = 0;
     for (int height = 0; height < actual.Height; height++)
     {
         for (int width = 0; width < actual.Width; width++)
         {
             if (!frame.GetPixel(width, height).Equals(actual.GetPixel(width, height)))
             {
                 actualMean++;
             }
         }
     }
     Assert.AreEqual(expectedMean, actualMean, "Process does not work with mean. ");
 }
Example #7
0
 public void NoiseGeneratorConstructorTest()
 {
     NoiseGenerator target = new NoiseGenerator();
     Assert.IsTrue(target is NoiseGenerator, "The returned object is not a valid NoiseGenerator instance.");
 }
Example #8
0
 public void namePluginTest()
 {
     NoiseGenerator target = new NoiseGenerator();
     string expected = "NoiseGenerator";
     string actual;
     target.namePlugin = expected;
     actual = target.namePlugin;
     Assert.AreEqual(expected, actual);
 }