Exemple #1
0
        public void DestroyPatientContact_GivenANullPatientContact_ThrowsArgumentException()
        {
            var patientContactRepository = new Mock <IPatientContactRepository> ();
            var patientContactFactory    = new PatientContactFactory(
                patientContactRepository.Object);

            patientContactFactory.DestroyPatientContact(null);
        }
Exemple #2
0
        public void DestroyPatientContact_GivenAPatientContact_ContactIsTransient()
        {
            bool isTransient = false;

            var patientContactRepository = new Mock <IPatientContactRepository> ();

            patientContactRepository
            .Setup(p => p.MakeTransient(It.IsAny <PatientContact> ()))
            .Callback(() => isTransient = true);
            var patientContactFactory = new PatientContactFactory(
                patientContactRepository.Object);

            var patient        = new Mock <Patient> ();
            var patientContact = new Mock <PatientContact> ();

            patientContact.Setup(p => p.Patient).Returns(patient.Object);

            patientContactFactory.DestroyPatientContact(patientContact.Object);

            Assert.IsTrue(isTransient);
        }