Example #1
0
        public void InsertTest()
        {
            TestUtils.Security.SetCurrentUser(TestEnums.User.constDoctorID);

            var doctorSchedule = DoctorScheduleServiceTest.CreateNewDoctorSchedule();
            var target         = DoctorScheduleEN.GetService("");

            target.Insert(doctorSchedule, new InsertParameters());
            // Happy scenario without exception
        }
Example #2
0
        private static void PopulateDatabase(int startDate, int endDate, int numberOfSamples)
        {
            var target = DoctorScheduleEN.GetService("");

            for (int i = 1; i < numberOfSamples; i++)
            {
                var doctorSchedule = DoctorScheduleServiceTest.CreateNewDoctorSchedule();
                int everyFiveMinuteCountInStartDateToEndDate = (endDate - startDate) / 60 / 5;
                int randomNumberInEveryFiveMinuteFromStart   = TestUtils.RandomUtils.RandomNumber(0, everyFiveMinuteCountInStartDateToEndDate);
                int randomTime = startDate + (randomNumberInEveryFiveMinuteFromStart * 60 * 5);
                //TestUtils.RandomUtils.RandomNumber(5, 60) * 60; //every minute is 60 seconds
                doctorSchedule.SlotUnixEpoch = randomTime;
                try
                {
                    target.Insert(doctorSchedule, null);
                }
                catch (BRException)
                {
                    // just don't do anything
                    //i--;
                }
            }
        }