public static bool Update_camera(Model_clienti m) { if (!Verificare.Verificare_camera(m.tip_camera)) { using (MySqlConnection conn = GetConnection()) { conn.Open(); string query, id; id = Cautare_camera_pe_tip(m.tip_camera); if (id == null) { return(false); } query = "UPDATE camere SET " + m.tip_camera.ToString() + "='rezervat' WHERE ID='" + id + "';"; MySqlCommand cmd = new MySqlCommand(query, conn); MySqlDataReader myreader; myreader = cmd.ExecuteReader();//EXECUTE QUERY m.id_camera = id; return(true); } } else { return(false); } }
public void Test_verificare_camera_good() { //Arrange bool result = true; //Act result = Verificare.Verificare_camera(Model_clienti.Tip_camera.Lux); //Assert Assert.IsFalse(result); }
public void Test_verificare_camera_fail() { //Arrange bool result = true; //Act result = Verificare.Verificare_camera(Model_clienti.Tip_camera.Standard); //Assert Assert.IsTrue(result); }
public void Test_nume_fail(string nume) { //Arrange bool result = true; //Act result = Verificare.Verificare_nume(nume); //Assert Assert.IsTrue(result); }
public void Test_verificare_camera_disponibila_fail() { //Arrange bool result = false; //Act result = Verificare.Verificare_camera(Model_clienti.Tip_camera.Standard, model_client.check_in, model_client.check_out); //Assert Assert.IsTrue(result); }
public void Test_verificare_camera_disponibila_good() { //Arrange bool result = false; //Act result = Verificare.Verificare_camera(model_client.tip_camera, model_client.check_in, model_client.check_out); //Assert Assert.IsFalse(result); }
public void Test_verificare_tip_camera_good() { //Arrange Model_clienti m1 = new Model_clienti(); m1.ID = "1"; bool result = false; //Act result = Verificare.Verificare_tip_camera_modificat(m1); //Assert Assert.IsFalse(result); }
public void Test_verificare_date_valabile_good(string check_in, string check_out) { //Arrange DateTime check_ind = DateTime.Parse(check_in); DateTime check_outd = DateTime.Parse(check_out); Tip_camera t1 = Tip_camera.Standard; Tip_camera t2 = Tip_camera.Lux; Tip_camera t3 = Tip_camera.Superior; bool result1, result2, result3; //Act result1 = Verificare.Verificare_date_valabile(check_ind, check_outd, t1); result2 = Verificare.Verificare_date_valabile(check_ind, check_outd, t2); result3 = Verificare.Verificare_date_valabile(check_ind, check_outd, t3); //Assert Assert.IsFalse(result1); Assert.IsFalse(result2); Assert.IsFalse(result3); }
public void Test_verificare_date_valabile_fail(string check_in, string check_out) { //Arrange DateTime check_ind = DateTime.Parse(check_in); DateTime check_outd = DateTime.Parse(check_out); Tip_camera t2 = Tip_camera.Lux; Tip_camera t3 = Tip_camera.Superior; bool result2, result3; //Act result2 = Verificare.Verificare_date_valabile(check_ind, check_outd, t2); result3 = Verificare.Verificare_date_valabile(check_ind, check_outd, t3); //Assert if (result2 == true || result3 == true) { Assert.Pass(); } else { Assert.Fail(); } }
public static void Verif_up(Model_clienti m) { Verificare.Verificari_update(m); }
public static void Verif(Model_clienti m) { Verificare.Verificari(m); }
private static void Verif(Model_clienti m) { Verificare.Verificari(m); }