Example #1
0
        public async Task GetLinksAsync_WhenSubredditIsNull_ThrowsArgumentNullException()
        {
            IRedditAccessToken     accessToken = CreateRedditAccessToken();
            const IRedditSubreddit subreddit   = null;

            IRedditRepository sut = CreateSut();

            await sut.GetLinksAsync(accessToken, subreddit);
        }
Example #2
0
        public async Task GetLinksAsync_WhenCalled_AssertHandleAsyncWasCalledOnExceptionHandler()
        {
            IRedditAccessToken redditAccessToken = CreateRedditAccessToken();
            IRedditSubreddit   subreddit         = CreateRedditSubreddit();

            IRedditRepository sut = CreateSut();

            await sut.GetLinksAsync(redditAccessToken, subreddit);

            _exceptionHandlerMock.Verify(m => m.HandleAsync(It.Is <Exception>(exception =>
                                                                              exception != null &&
                                                                              exception.InnerException == null &&
                                                                              exception.GetType() == typeof(UnauthorizedAccessException))),
                                         Times.Once());
        }