Exemplo n.º 1
0
        public void SetUp()
        {
            transaction = new TransactionScope();
            DALFactory factory = DALFactory.GetInstance();
            db = factory.CreateDatabase();
            dao = factory.CreateTimeSlotDAO(db);
            timeslot1 = new TimeSlot {
                Id = 1,
                Start = 13,
                End = 14
            };
            timeslot2 = new TimeSlot {
                Id = 2,
                Start = 1,
                End = 2
            };

            runDbCommands(db, new List<string> {
                "SET FOREIGN_KEY_CHECKS=0",
                "DELETE FROM `timeslot`",
                $"INSERT INTO `timeslot` VALUES (1, '{timeslot1.Start}', '{timeslot1.End}')",
                $"INSERT INTO `timeslot` VALUES (2, '{timeslot2.Start}', '{timeslot2.End}')",
                "DELETE FROM `spectacleday_timeslot`",
                $"INSERT INTO `spectacleday_timeslot` VALUES (1, 1, 1)",
                $"INSERT INTO `spectacleday_timeslot` VALUES (2, 2, 1)"
            });
        }
Exemplo n.º 2
0
 public void SetUp()
 {
     timeslot = new TimeSlot();
 }
Exemplo n.º 3
0
 public static bool IsEqualTo(this TimeSlot t1, TimeSlot t2)
 {
     return t1.Id == t2.Id &&
         t1.Start == t2.Start &&
         t1.End == t2.End;
 }