Example #1
0
        public void Setup()
        {
            var providerDomain = new ProviderDomain(new ProvidersRepository());
            var patientDomain  = new PatientDomain(new PatientsRepository());
            var serviceDomain  = new ServiceDomain(new ServicesRepository());

            var provider = new Provider
            {
                Name = "Dr. Oz",
                CertificationLevel = 10
            };

            var differentProvider = new Provider
            {
                Name = "Dr. Jekyll",
                CertificationLevel = 10
            };

            var patient = new Patient
            {
                Name = "Dorothy",
                Age  = 16
            };

            var differentPatient = new Patient
            {
                Name = "Glenda",
                Age  = 99
            };

            var service = new Service
            {
                Name                       = "A New Heart",
                Duration                   = TimeSpan.FromHours(5),
                MinimumRequiredAge         = 16,
                RequiredCertificationLevel = 10
            };

            var shortService = new Service
            {
                Name                       = "Consultation",
                Duration                   = TimeSpan.FromMinutes(30),
                MinimumRequiredAge         = 16,
                RequiredCertificationLevel = 10
            };

            providerDomain.CreateProvider(provider);
            providerDomain.CreateProvider(differentProvider);
            patientDomain.CreatePatient(patient);
            patientDomain.CreatePatient(differentPatient);
            serviceDomain.CreateService(service);
            serviceDomain.CreateService(shortService);
        }
Example #2
0
        public void Scheduling_Appointment_For_Underage_Patients_Should_Fail()
        {
            //Arrange
            Setup();
            var providerDomain    = new ProviderDomain(new ProvidersRepository());
            var patientDomain     = new PatientDomain(new PatientsRepository());
            var serviceDomain     = new ServiceDomain(new ServicesRepository());
            var appointmentDomain = new AppointmentsDomain(new AppointmentsRepository());

            var savedProvider   = providerDomain.GetProvider(1);
            var savedService    = serviceDomain.GetService(1);
            var underagePatient = new Patient
            {
                Age  = 15,
                Name = "Lion"
            };

            underagePatient = patientDomain.CreatePatient(underagePatient);

            var appointment = new Appointment
            {
                Patient                  = underagePatient,
                Provider                 = savedProvider,
                Service                  = savedService,
                ReasonForVisit           = "There's no place like home",
                RequestedAppointmentDate = DateTime.Parse("2000/01/01 09:00:00.000"),
            };

            //Act
            var savedAppointment = appointmentDomain.SetAppointment(appointment);
        }