public async Task HandleWithNullGetWatchListRequestCallRetrunsNotFoundResult() { // Arrange repository = new Mock <IRepository>(); getWatchList = new GetWatchList(repository.Object); getWatchListRequest = null; // Act CancellationToken cancellationToken; var result = await getWatchList.Handle(getWatchListRequest, cancellationToken); // Assert Assert.Null(result); }
public async Task HandleWithValidGetWatchListRequestCallGetWatchListRequestAsExpectedResult() { // Arrange repository = new Mock <IRepository>(); repository.Setup(m => m.Query <WatchList>()) .Returns(GetMockWatchList()); getWatchList = new GetWatchList(repository.Object); getWatchListRequest = new GetWatchListRequest(); MapperInitialize(); // Act CancellationToken cancellationToken; var result = await getWatchList.Handle(getWatchListRequest, cancellationToken); // Assert Assert.NotNull(result); Assert.Equal(2, result.Count); }