Exemple #1
0
        public void Find_specific_prescription()
        {
            PrepareStubs();
            var prescriptionService = new MedicationPrescriptionService
                                      (
                _prescriptionStubRepository.Object,
                _mockDiagnosisConnection.Object
                                      );

            IEnumerable <MedicationPrescription> matchedPrescriptions = prescriptionService.SimpleSearch("Brufen");

            Assert.Equal("Brufen", matchedPrescriptions.ToList()[0].Medication.Name);
        }
Exemple #2
0
        public void Find_no_prescription()
        {
            PrepareStubs();
            var prescriptionService = new MedicationPrescriptionService
                                      (
                _prescriptionStubRepository.Object,
                _mockDiagnosisConnection.Object
                                      );

            IEnumerable <MedicationPrescription> matchedPrescriptions = prescriptionService.SimpleSearch("xxx");

            Assert.Empty(matchedPrescriptions);
        }
Exemple #3
0
        public void Find_all_prescription()
        {
            PrepareStubs();
            var prescriptionService = new MedicationPrescriptionService
                                      (
                _prescriptionStubRepository.Object,
                _mockDiagnosisConnection.Object
                                      );

            IEnumerable <MedicationPrescription> matchedPrescriptions = prescriptionService.SimpleSearch("Br");

            Assert.All(matchedPrescriptions, prescription =>
                       Assert.Contains("Br", prescription.Medication.Name));
        }