public async Task StorageLocation_RemoveAsync() { var storageLocation = _fixture.Create <StorageLocation>(); _mockStorageLocationRepository.Setup(m => m.RemoveAsync(storageLocation.StorageLocationId)).ReturnsAsync(1); var actionSuccess = await _storageLocationService.RemoveAsync(storageLocation.StorageLocationId); actionSuccess.Should().Be(true); Mock.VerifyAll(); }
public async Task <IActionResult> RemoveStorageLocation(int id) { try { var success = await _storageLocationService.RemoveAsync(id); if (success) { return(Ok()); } return(NotFound()); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex)); } }