public async Task BoardService_FindAsync_InputInvalid_Should_ReturnNull() { var mockUnitOfWork = new Mock <IUnitOfWork>(); var mockBoardRepository = new MockBoardRepository().MockFindAsyncInvalid(); var boardService = new BoardService(mockBoardRepository.Object, mockUnitOfWork.Object); var results = await boardService.FindAsync(1); Assert.IsNull(results); mockBoardRepository.VerifyFindAsync(Times.Once()); }
public async Task BoardService_FindAsync_Should_ReturnBoard() { var mockUnitOfWork = new Mock <IUnitOfWork>(); var mockBoardRepository = new MockBoardRepository().MockFindAsync(Task.FromResult(Generics.Board)); var boardService = new BoardService(mockBoardRepository.Object, mockUnitOfWork.Object); var results = await boardService.FindAsync(1); Assert.IsNotNull(results); mockBoardRepository.VerifyFindAsync(Times.Once()); }