Exemplo n.º 1
0
        private void TestColorInfoDialog(IColorsLabController colorsLab)
        {
            IColorsLabMoreInfoDialog infoDialog = null;

            try
            {
                infoDialog = colorsLab.ShowMoreColorInfo(colorsLab.GetMonoPanel1().BackColor);
                // rgb text is like "RGB: 163, 192, 242"
                var rgbColor = infoDialog.GetRgbText().Substring(5).Split(',');
                var r        = Int32.Parse(rgbColor[0].Trim());
                var g        = Int32.Parse(rgbColor[1].Trim());
                var b        = Int32.Parse(rgbColor[2].Trim());
                // rgb values can have errors within threshold 2
                Assert.IsTrue(Math.Abs(r - 163) <= 2);
                Assert.IsTrue(Math.Abs(g - 192) <= 2);
                Assert.IsTrue(Math.Abs(b - 242) <= 2);
            }
            finally
            {
                if (infoDialog != null)
                {
                    infoDialog.TearDown();
                }
            }
        }
Exemplo n.º 2
0
 private void TestColorInfoDialog(IColorsLabController colorsLab)
 {
     IColorsLabMoreInfoDialog infoDialog = null;
     try
     {
         infoDialog = colorsLab.ShowMoreColorInfo(colorsLab.GetMonoPanel1().BackColor);
         // rgb text is like "RGB: 163, 192, 242"
         var rgbColor = infoDialog.GetRgbText().Substring(5).Split(',');
         var r = Int32.Parse(rgbColor[0].Trim());
         var g = Int32.Parse(rgbColor[1].Trim());
         var b = Int32.Parse(rgbColor[2].Trim());
         // rgb values can have errors within threshold 2
         Assert.IsTrue(Math.Abs(r - 163) <= 2);
         Assert.IsTrue(Math.Abs(g - 192) <= 2);
         Assert.IsTrue(Math.Abs(b - 242) <= 2);
     }
     finally
     {
         if (infoDialog != null) infoDialog.TearDown();
     }
 }
Exemplo n.º 3
0
        private void TestFavoriteColors(IColorsLabController colorsLab)
        {
            var favPanel1 = colorsLab.GetFavColorPanel1();
            var originalFavColor = favPanel1.BackColor;

            try
            {
                // empty fav colors
                colorsLab.GetEmptyFavColorsButton().PerformClick();
                var colorAftReset = favPanel1.BackColor;
                AssertEqual(Color.White, colorAftReset);

                // set mono panel1's color as fav color
                var monoPanel1 = colorsLab.GetMonoPanel1();
                ApplyColor(monoPanel1, favPanel1);
                AssertEqual(monoPanel1.BackColor, favPanel1.BackColor);
            }
            finally
            {
                // reset fav colors from last time saved
                colorsLab.GetResetFavColorsButton().PerformClick();
                AssertEqual(originalFavColor, favPanel1.BackColor);
            }
        }
Exemplo n.º 4
0
        private void TestFavoriteColors(IColorsLabController colorsLab)
        {
            var favPanel1        = colorsLab.GetFavColorPanel1();
            var originalFavColor = favPanel1.BackColor;

            try
            {
                // empty fav colors
                colorsLab.GetEmptyFavColorsButton().PerformClick();
                var colorAftReset = favPanel1.BackColor;
                AssertEqual(Color.White, colorAftReset);

                // set mono panel1's color as fav color
                var monoPanel1 = colorsLab.GetMonoPanel1();
                ApplyColor(monoPanel1, favPanel1);
                AssertEqual(monoPanel1.BackColor, favPanel1.BackColor);
            }
            finally
            {
                // reset fav colors from last time saved
                colorsLab.GetResetFavColorsButton().PerformClick();
                AssertEqual(originalFavColor, favPanel1.BackColor);
            }
        }