public async Task GetLinksAsync_WhenSubredditIsNull_ThrowsArgumentNullException() { IRedditAccessToken accessToken = CreateRedditAccessToken(); const IRedditSubreddit subreddit = null; IRedditRepository sut = CreateSut(); await sut.GetLinksAsync(accessToken, subreddit); }
public async Task GetSpecificSubredditAsync_WhenKnownSubredditIsNull_ThrowsArgumentNullException() { IRedditAccessToken accessToken = CreateRedditAccessToken(); const IRedditKnownSubreddit knownSubreddit = null; IRedditRepository sut = CreateSut(); await sut.GetSpecificSubredditAsync(accessToken, knownSubreddit); }
public async Task GetSubredditsForAuthenticatedUserAsync_WhenCalled_AssertHandleAsyncWasCalledOnExceptionHandler() { IRedditAccessToken redditAccessToken = CreateRedditAccessToken(); IRedditRepository sut = CreateSut(); await sut.GetSubredditsForAuthenticatedUserAsync(redditAccessToken); _exceptionHandlerMock.Verify(m => m.HandleAsync(It.Is <Exception>(exception => exception != null && exception.InnerException == null && exception.GetType() == typeof(UnauthorizedAccessException))), Times.Once()); }
public PostController(IRedditRepository <Post> postRepo) { this.postRepo = postRepo; }
public async Task GetSubredditsForAuthenticatedUserAsync_WhenAccessTokenIsNull_ThrowsArgumentNullException() { IRedditRepository sut = CreateSut(); await sut.GetSubredditsForAuthenticatedUserAsync(null); }
public RedditController(IRedditAccess reddit, IRedditRepository repository) { _reddit = reddit; _repository = repository; }