private void btnDefaut_Click(object sender, EventArgs e) { logger.ConditionalDebug("btnDefaut_Click"); resetting = true; duoConfCopy.Reset(); resetting = false; }
public void TestDuoConfig() { DuoConfig dc = new DuoConfig(); Assert.AreEqual(DuoConfig.ColorisFunction.syllabes, dc.colorisFunction); dc.colorisFunction = DuoConfig.ColorisFunction.mots; Assert.AreEqual(DuoConfig.ColorisFunction.mots, dc.colorisFunction); dc.colorisFunction = DuoConfig.ColorisFunction.lettres; Assert.AreEqual(DuoConfig.ColorisFunction.lettres, dc.colorisFunction); UndoFactory.UndoLastAction(); Assert.AreEqual(DuoConfig.ColorisFunction.mots, dc.colorisFunction); Assert.AreEqual(DuoConfig.Alternance.mots, dc.alternance); dc.alternance = DuoConfig.Alternance.lignes; Assert.AreEqual(DuoConfig.Alternance.lignes, dc.alternance); dc.alternance = DuoConfig.Alternance.mots; Assert.AreEqual(DuoConfig.Alternance.mots, dc.alternance); UndoFactory.UndoLastAction(); Assert.AreEqual(DuoConfig.Alternance.lignes, dc.alternance); Assert.AreEqual(1, dc.nbreAlt); dc.nbreAlt = 2; Assert.AreEqual(2, dc.nbreAlt); dc.nbreAlt = 3; Assert.AreEqual(3, dc.nbreAlt); UndoFactory.UndoLastAction(); Assert.AreEqual(2, dc.nbreAlt); dc.Reset(); Assert.AreEqual(DuoConfig.ColorisFunction.syllabes, dc.colorisFunction); Assert.AreEqual(DuoConfig.Alternance.mots, dc.alternance); Assert.AreEqual(1, dc.nbreAlt); UndoFactory.UndoLastAction(); Assert.AreEqual(DuoConfig.ColorisFunction.mots, dc.colorisFunction); Assert.AreEqual(DuoConfig.Alternance.lignes, dc.alternance); Assert.AreEqual(2, dc.nbreAlt); UndoFactory.RedoLastCanceledAction(); Assert.AreEqual(DuoConfig.ColorisFunction.syllabes, dc.colorisFunction); Assert.AreEqual(DuoConfig.Alternance.mots, dc.alternance); Assert.AreEqual(1, dc.nbreAlt); }