Example #1
0
        public void CreateAllergy_NullPatient_ThrowsArgumentException()
        {
            var allergyRepository = new Mock <IAllergyRepository> ();
            var allergyFactory    = new AllergyFactory(
                allergyRepository.Object);
            var allergyStatus = new Mock <AllergyStatus> ();
            var allergen      = new Mock <CodedConcept> ();

            allergyFactory.CreateAllergy(null, allergyStatus.Object, allergen.Object);
        }
Example #2
0
        public void CreateAllergy_NullAllergen_ThrowsArgumentException()
        {
            var allergyRepository = new Mock <IAllergyRepository> ();
            var allergyFactory    = new AllergyFactory(
                allergyRepository.Object);

            var patient       = new Mock <Patient> ();
            var allergyStatus = new Mock <AllergyStatus> ();

            allergyFactory.CreateAllergy(patient.Object, allergyStatus.Object, null);
        }
Example #3
0
        private Allergy CreateAllergyByAllergyFactory()
        {
            var allergyRepository = new Mock <IAllergyRepository> ();
            var allergyFactory    = new AllergyFactory(
                allergyRepository.Object);

            var patient       = new Mock <Patient> ();
            var allergyStatus = new Mock <AllergyStatus> ();
            var allergen      = new CodedConceptBuilder().WithCodedConceptCode("TheCode");
            var allergy       = allergyFactory.CreateAllergy(patient.Object, allergyStatus.Object, allergen);

            return(allergy);
        }