public void Get_all_returns_data() { pharmacyRepository.GetAll().Returns(this.GetListOfPharmacy()); List <IdentifiableDTO <PharmacyDTO> > returnedList = pharmacyService.GetAll().ToList(); Assert.Equal(2, returnedList.Count); }
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)); }
public IEnumerable <IdentifiableDTO <PharmacyDTO> > GetAll() { return(_pharmacyService.GetAll()); }
public IEnumerable <Pharmacy> Get() { return(_pharmacyService.GetAll()); }