Beispiel #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);
        }
Beispiel #2
0
        public void Scheduling_Appointment_For_Unqualified_Provider_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 savedService        = serviceDomain.GetService(1);
            var savedPatient        = patientDomain.GetPatient(1);
            var unqualifiedProvider = new Provider
            {
                Name = "Dr Quack.",
                CertificationLevel = 1
            };

            unqualifiedProvider = providerDomain.CreateProvider(unqualifiedProvider);

            var appointment = new Appointment
            {
                Patient                  = savedPatient,
                Provider                 = unqualifiedProvider,
                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);
        }