Example #1
0
        public void Get_all_returns_data()
        {
            pharmacyRepository.GetAll().Returns(this.GetListOfPharmacy());

            List <IdentifiableDTO <PharmacyDTO> > returnedList = pharmacyService.GetAll().ToList();

            Assert.Equal(2, returnedList.Count);
        }
Example #2
0
 public IActionResult SendMail()
 {
     foreach (Pharmacy pharmacy in _pharmacyService.GetAll())
     {
         MailRequestDTO mailRequest = new MailRequestDTO {
             ToEmail = pharmacy.Email, Subject = "Message from Medbay hospital", Body = "New urgent procurement in MedbayTech hospital!"
         };
         _mailService.SendMailAsync(mailRequest).Wait();
     }
     return(Ok());
 }
        public void Given_GetAll_Then_ShouldReturnAllPharmacies()
        {
            //Arrange
            var expectedResult = PharmacyFactory.GetPharmacies();

            //Act
            var result = sut.GetAll();

            //Assert
            pharmacyRepositoryMock.Verify(x => x.GetAll(), Times.Once);
            result.Should().HaveCount(expectedResult.Count());
        }
        public IActionResult GetAll()
        {
            try
            {
                return(Ok(_pharmacyService.GetAll()));
            }
            catch (NotFoundEntityException e)
            {
                return(StatusCode(404));
            }

            catch (InternalServerErrorException e)
            {
                return(StatusCode(500));
            }
        }
        public IActionResult GetAll()
        {
            var result = pharmacyService.GetAll();

            return(Ok(result));
        }
Example #6
0
 public IEnumerable <IdentifiableDTO <PharmacyDTO> > GetAll()
 {
     return(_pharmacyService.GetAll());
 }
Example #7
0
 public IEnumerable <Pharmacy> Get()
 {
     return(_pharmacyService.GetAll());
 }