public static void RemoveItens() { ValidityControl.UpdateListDatesFromDB(); foreach (ValidityDateControl tmp in ValidityControl.GetListDates()) { ValidityDateControlModel.Delete(tmp); } ValidityControl.ClearListDates(); }
public void UpdateListTest() { ValidityControl.ClearListDates(); ValidityDateControl date = new ValidityDateControl(5, new DateTime(1991, 9, 24, 0, 0, 0), new DateTime(2017, 10, 10, 23, 59, 59)); ValidityControl.AddDateControl(date); ValidityControl.ClearListDates(); ValidityControl.UpdateListDatesFromDB(); ValidityDateControl dateItem = ValidityControl.GetListDates()[0]; Assert.IsTrue(date.IsSameDate(dateItem)); }
public void SetPriceTest() { DateTime initialDateControl = new DateTime(2015, 8, 16, 0, 0, 0); DateTime finalDateControl = new DateTime(2015, 11, 15, 23, 59, 59); double price = 5; ValidityControl.AddDateControl(price, initialDateControl, finalDateControl); List <ValidityDateControl> list = ValidityControl.GetListDates(); ValidityDateControl dateControl = list[0]; Assert.IsTrue(DateTime.Compare(dateControl.InitialDate, initialDateControl) == 0 && DateTime.Compare(dateControl.FinalDate, finalDateControl) == 0 && dateControl.HourPrice == price, "Houve um erro, datas diferentes"); }