예제 #1
0
        public void RegisteringTwoNewPatientWithTheSameName()
        {
            var hospital        = new Hospital();
            var vm              = new PatientViewModel(hospital);
            var closeActionMock = new Mock <Action>();

            vm.CloseAction = closeActionMock.Object;
            vm.PatientName = "TestPatient";
            vm.SaveNewPatient(null);
            Assert.AreEqual(hospital.Consultations.Count, 1);
            vm.PatientName = "TestPatient";
            vm.SaveNewPatient(null);
            Assert.AreEqual(vm.ErrorMessage, "A patient with the specifed name already exist.");
        }
예제 #2
0
        public void RegisteringNewPatientShouldAlsoScheduleInitialConsultation()
        {
            var hospital        = new Hospital();
            var vm              = new PatientViewModel(hospital);
            var closeActionMock = new Mock <Action>();

            vm.CloseAction = closeActionMock.Object;
            vm.PatientName = "TestPatient";
            vm.SaveNewPatient(null);
            Assert.AreEqual(hospital.Consultations.Count, 1);
        }