Example #1
0
        public static void Should_throw_a_exception_when_add_a_null_medical_appointment()
        {
            // arrange
            var person = new FakePerson((FakeCode)"code", "name");

            // act & assert
            Assert.Throws <ArgumentNullException>(() => person.AddMedicalAppointment(null));
        }
Example #2
0
        public static void Should_parse_a_person_with_medical_appointments_into_a_string()
        {
            // arrange
            var person              = new FakePerson((FakeCode)"code", "name");
            var doctor              = new Doctor((Crm)"12345", "name", MedicalSpecialty.GeneralClinic);
            var customer            = new Customer((Cpf)"012345678-90", "name", CustomerType.Normal);
            var medicalAppointment1 = new MedicalAppointment(DateTime.Now, MedicalAppointmentType.OnDemand, customer, doctor);
            var medicalAppointment2 = new MedicalAppointment(DateTime.Now, MedicalAppointmentType.OnDemand, customer, doctor);

            person.AddMedicalAppointment(medicalAppointment1);
            person.AddMedicalAppointment(medicalAppointment2);

            // act
            var result = person.ToString();

            // assert
            Assert.Equal($"Código: code - Nome: name - Consultas: [{medicalAppointment1},{medicalAppointment2}] - Valor Total: 0", result);
        }
Example #3
0
        public static void Should_add_a_medical_appointment()
        {
            // arrange
            var person             = new FakePerson((FakeCode)"code", "name");
            var doctor             = new Doctor((Crm)"12345", "name", MedicalSpecialty.GeneralClinic);
            var customer           = new Customer((Cpf)"012345678-90", "name", CustomerType.Normal);
            var medicalAppointment = new MedicalAppointment(DateTime.Now, MedicalAppointmentType.OnDemand, customer, doctor);

            // act
            person.AddMedicalAppointment(medicalAppointment);

            // assert
            Assert.True(!person.MedicalAppointments.IsEmpty());
            Assert.True(person.MedicalAppointments.Count() == 1);
        }