public void CuandoGetAllAreas() { //Arrange //Act IAreaServices areaServices = Substitute.For <IAreaServices>(); var result = areaServices.GetAllAreas(); //Assert Assert.IsNotNull(result); }
public void CanGetAllAreas() { // Expected Result ICollection <Area> areas = fakeAreaRepository._fakeRepository.Where(x => x.Dormant == false).ToList(); ICollection <AreaViewModel> expected = areas.Select(x => AreaViewModel.ToViewModel(x)).ToList(); // Actual Result ICollection <AreaViewModel> result = _areaServices.GetAllAreas(); // Assert expected.Should().BeEquivalentTo(result); }
public IActionResult GetAllAreas() { try { return(Ok(_areaServices.GetAllAreas())); } catch (Exception e) { return(BadRequest(e)); } }
public async Task <List <Area> > GetAllAreas() { return(await _areaServices.GetAllAreas()); }