public async Task StorageLocation_GetAllAsync() { var listStorageLocationtModel = _fixture.CreateMany <StorageLocationViewModel>(); _mockStorageLocationRepository.Setup(m => m.GetAllAsync()).ReturnsAsync(listStorageLocationtModel.ToList()); var StorageLocationtModel = await _storageLocationService.GetAllAsync(); StorageLocationtModel.Should().BeOfType <List <StorageLocationViewModel> >(); Mock.VerifyAll(); }
public async Task <IActionResult> GetAll() { try { return(Ok(await _storageLocationService.GetAllAsync())); } catch (Exception ex) { return(BadRequest($"Erro ao buscar localizacoes ({ex})")); } }