public async Task Should_GetByIdAsync_ReturnsAHouses() { //Arrange const int houseId = 1; var houseEntity = new HouseEf { Id = houseId }; var houseModels = new HouseToUpdate { Id = houseId }; var parameter = new Parameter { ItemsPerPage = 5 }; _houseRepositoryMock.Setup(x => x.GetByIdAsync(houseId)) .ReturnsAsync(houseEntity); _mapperMock.Setup(x => x.Map <HouseToUpdate>(houseEntity)) .Returns(houseModels); _manager = new HouseManager(_mapperMock.Object, _houseRepositoryMock.Object); //Act var model = await _manager.GetByIdAsync(houseId); //Assert _houseRepositoryMock.Verify(x => x.GetByIdAsync(houseId), Times.Once); _mapperMock.Verify(x => x.Map <HouseToUpdate>(houseEntity), Times.Once); Assert.NotNull(model); Assert.Equal(houseId, model.Id); }