public async Task ReaderService_GetByIdAsync_ReturnsReaderModels() { //arrange var expected = GetTestReaderModels().First(); var id = 1; var mockUnitOfWork = new Mock <IUnitOfWork>(); mockUnitOfWork .Setup(m => m.ReaderRepository.GetByIdWithDetails(It.IsAny <int>())) .ReturnsAsync(GetTestReaderEntities().First()); var readerService = new ReaderService(mockUnitOfWork.Object, UnitTestHelper.CreateMapperProfile()); //act var actual = await readerService.GetByIdAsync(id); //assert Assert.IsInstanceOf <ReaderModel>(actual); Assert.IsTrue(_readerModelComparer.Equals(expected, actual)); }