private void timer1_Tick(object sender, EventArgs e) { try { maConnexion = ConnexionSql.getInstance("localhost", "gsb", "root", ""); dateJour = Convert.ToInt32(GD.getJour()); if (dateJour >= 1 && dateJour <= 10) { maConnexion.openConnection(); maCo = maConnexion.reqExec("update fichefrais set idEtat ='CL' where idEtat ='CR' and mois = '" + GD.getDateMoisPrecedent() + "'"); maCo.ExecuteNonQuery(); maCo = maConnexion.reqExec("Select * from fichefrais where mois='" + dateTest + "'"); maConnexion.closeConnection(); } else if (dateJour >= 20 && dateJour <= 31) { maConnexion.openConnection(); maCo = maConnexion.reqExec("update fichefrais set idEtat ='VA' where idEtat ='RB' and mois = '" + GD.getDateMoisPrecedent() + "'"); maCo.ExecuteNonQuery(); dateTest = GD.getDateMoisPrecedent(); maCo = maConnexion.reqExec("Select * from fichefrais where mois='" + dateTest + "'"); maConnexion.closeConnection(); } } catch (Exception emp) { throw (emp); } }
public void TestMethod1() { Assert.AreEqual("23", x.getJour(), "echec erreur"); Assert.AreEqual("202103", x.getDateDuJour(), "echec erreur"); Assert.AreEqual("202103", x.getDateMoisPrecedent(), "echec erreur"); }
public void TestMethod6() { Assert.AreEqual("202101", c.getDateMoisPrecedent(), "echec erreur"); }