コード例 #1
0
        public void CuandoGetAllAreas()
        {
            //Arrange
            //Act
            IAreaServices areaServices = Substitute.For <IAreaServices>();
            var           result       = areaServices.GetAllAreas();

            //Assert
            Assert.IsNotNull(result);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public IActionResult GetAllAreas()
 {
     try
     {
         return(Ok(_areaServices.GetAllAreas()));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
コード例 #4
0
 public async Task <List <Area> > GetAllAreas()
 {
     return(await _areaServices.GetAllAreas());
 }