public void GetByIdTest_ThrowException() { mockCache.Setup(x => x.GetById(5)).ThrowsAsync(new JobNotFoundException(5)); var instance = new MergeSortOperation(mockCache.Object, mockLogger.Object); Assert.ThrowsAsync <JobNotFoundException>(() => instance.GetById(5)); }
public async Task GetByIdTest_Success() { var mockValue = TestData.completedExecution; mockCache.Setup(x => x.GetById(5)).ReturnsAsync(mockValue); var instance = new MergeSortOperation(mockCache.Object, mockLogger.Object); var result = await instance.GetById(5); mockValue.Should().BeEquivalentTo(result); }