Esempio n. 1
0
        public void GetImmunisationCount_Return_Success()
        {
            int patientId    = 100;
            var immunisation = new ImmunisationDto();
            var patient      = new PatientDto(DateTime.Now)
            {
                Id = 100, Immunisations = new List <ImmunisationDto>()
                {
                    new ImmunisationDto()
                }
            };

            var service = GetService();

            immunisationRepository.Setup(x => x.GetTotal(It.IsAny <int>(), It.IsAny <DateTime>()))
            .Returns(patient.Immunisations.Count);

            service.CreatePatient(patient);

            var count = service.GetImmunisationCount(patientId);

            immunisationRepository.Verify(x => x.GetTotal(It.IsAny <int>(), It.IsAny <DateTime>()), Times.Once);

            Assert.AreEqual(count, patient.Immunisations.Count);
        }
Esempio n. 2
0
        public void AddImmunisation_Return_Success()
        {
            int patientId    = 100;
            var immunisation = new ImmunisationDto();

            var service = GetService();

            service.AddImmunisation(patientId, immunisation);

            immunisationRepository.Verify(x => x.Add(It.IsAny <int>(), It.IsAny <Immunisation>()), Times.Once);
        }
Esempio n. 3
0
 public void AddImmunisation(int patientId, ImmunisationDto immunisation)
 {
     immunisationRepository.Add(patientId, mapper.Map <Immunisation>(immunisation));
 }