Exemple #1
0
 private void changeColorByButtonAndValidate(int rowIndex, EditCustomThemeDlg editCustomThemeDlg, DataGridView grid)
 {
     RunUI(() => editCustomThemeDlg.changeCateogry(EditCustomThemeDlg.ThemeCategory.precursors));
     RunUI(() => editCustomThemeDlg.changeRowColor(rowIndex, Color.Blue));
     Assert.AreEqual(ColorScheme.ColorSchemeDemo.Name, ColorSchemeList.DEFAULT.Name); // Not in demo mode
     Assert.AreEqual(grid.Rows[rowIndex].Cells[1].Value, "0, 0, 255");                // check rgb
     Assert.AreEqual(grid.Rows[rowIndex].Cells[2].Value, "#0000FF");                  // check hex
     RunUI(() => editCustomThemeDlg.changeCateogry(EditCustomThemeDlg.ThemeCategory.transitions));
     RunUI(() => editCustomThemeDlg.changeCateogry(EditCustomThemeDlg.ThemeCategory.precursors));
     Assert.AreEqual(grid.Rows[rowIndex].Cells[1].Value, "0, 0, 255");                 // check rgb
     Assert.AreEqual(grid.Rows[rowIndex].Cells[2].Value, "#0000FF");                   // check hex
     Assert.AreEqual(ColorScheme.ColorSchemeDemo.PrecursorColors.First(), Color.Blue); // check hex
 }
Exemple #2
0
 private void changeColorByManualAndValidate(int rowIndex, EditCustomThemeDlg editCustomThemeDlg,
                                             DataGridView grid)
 {
     RunUI(editCustomThemeDlg.changeToRGB);
     RunUI(() => editCustomThemeDlg.changeCateogry(EditCustomThemeDlg.ThemeCategory.precursors));
     RunUI(() => grid.Rows[rowIndex].Cells[1].Value = ("255, 0,0"));
     Assert.AreEqual(grid.Rows[rowIndex].Cells[2].Value, "#FF0000");
     assertColor(ColorScheme.ColorSchemeDemo.PrecursorColors.First(), Color.Red);
     RunUI(() => editCustomThemeDlg.changeCateogry(EditCustomThemeDlg.ThemeCategory.transitions));
     RunUI(() => grid.Rows[rowIndex].Cells[2].Value = ("#0000FF"));
     Assert.AreEqual(grid.Rows[rowIndex].Cells[1].Value, "0, 0, 255");
     assertColor(ColorScheme.ColorSchemeDemo.TransitionColors.First(), Color.Blue); // check hex
     RunUI(() => editCustomThemeDlg.changeCateogry(EditCustomThemeDlg.ThemeCategory.precursors));
     assertColor(ColorScheme.ColorSchemeDemo.PrecursorColors.First(), Color.Red);
     RunUI(() => editCustomThemeDlg.changeCateogry(EditCustomThemeDlg.ThemeCategory.transitions));
     assertColor(ColorScheme.ColorSchemeDemo.TransitionColors.First(), Color.Blue); // check hex
 }