public void TestScheduleCheckforInsertConflicts()
        {
            int nextEid = Employee.GenerateNextEid();
            Schedule s1 = new Schedule(Schedule.GenerateNextSid(), new DateTime(2013, 4, 1, 11, 0, 0), new DateTime(2013, 4, 1, 12, 30, 0), nextEid, "A");
            s1.Insert();

            Schedule overlapAfterS1 = new Schedule(Schedule.GenerateNextSid(), new DateTime(2013, 4, 1, 12, 0, 0), new DateTime(2013, 4, 1, 13, 0, 0), nextEid, "B");
            Assert.False(overlapAfterS1.CheckforInsertConflicts());

            Schedule overlapBeforeS1 = new Schedule(Schedule.GenerateNextSid(), new DateTime(2013, 4, 1, 10, 0, 0), new DateTime(2013, 4, 1, 12, 0, 0), nextEid, "B");
            Assert.False(overlapBeforeS1.CheckforInsertConflicts());

            Schedule insideS1 = new Schedule(Schedule.GenerateNextSid(), new DateTime(2013, 4, 1, 11, 30, 1), new DateTime(2013, 4, 1, 12, 0, 0), nextEid, "B");
            Assert.False(insideS1.CheckforInsertConflicts());

            Schedule containsS1 = new Schedule(Schedule.GenerateNextSid(), new DateTime(2013, 4, 1, 10, 0, 0), new DateTime(2013, 4, 1, 13, 0, 0), nextEid, "B");
            Assert.False(containsS1.CheckforInsertConflicts());

            Schedule noS1Overlap = new Schedule(Schedule.GenerateNextSid(), new DateTime(2013, 4, 1, 13, 0, 0), new DateTime(2013, 4, 1, 14, 0, 0), Employee.GenerateNextEid(), "B");
            Assert.True(noS1Overlap.CheckforInsertConflicts());

            s1.Delete();
        }
        public void TestScheduleSelectForAllAppointments()
        {
            Schedule s = new Schedule(Schedule.GenerateNextSid(), new DateTime(), new DateTime(), 1, "STW");
            s.Insert();

            ObservableCollection<Appointment> appts = Schedule.Select();

            Assert.True(appts.Count >= 1);

            s.Delete();
        }
        public void TestScheduleUpdate()
        {
            Schedule s = new Schedule(Schedule.GenerateNextSid(), new DateTime(), new DateTime(), 1, "STW");
            s.Insert();

            s.Start_time = new DateTime(2014, 10, 2);
            Assert.True(s.Update());

            s.Delete();
        }
        public void TestScheduleInsert()
        {
            Schedule s = new Schedule(Schedule.GenerateNextSid(), new DateTime(), new DateTime(), 1, "STW");
            Assert.True(s.Insert());

            s.Delete();
        }