Ejemplo n.º 1
0
        public void GetAllAsync_ShouldReturnAllSpecialities()
        {
            //arrange
            var expected = GetSpecialitiesDTO().ToList();

            _uowMock.Setup(e => e.SpecialityRepository.GetAllAsync().Result).Returns(GetSpecialitiesDAO());

            //act
            _sut = new SpecialityService(_uowMock.Object, UTestHelper.CreateMapper());
            var actual = _sut.GetAllAsync().Result.ToList();

            //assert
            for (int i = 0; i < actual.Count; i++)
            {
                Assert.AreEqual(expected[i].Id, actual[i].Id);
                Assert.AreEqual(expected[i].Name, actual[i].Name);
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Get()
        {
            var specialities = await _specialityService.GetAllAsync();

            return(Ok(specialities));
        }
Ejemplo n.º 3
0
 public async Task <ActionResult <IEnumerable <SpecialityModel> > > Get()
 {
     _logger.LogInformation("Call end-point all specialities");
     return(Ok(await _specialityService.GetAllAsync()));
 }