public async Task GetAuthenticatedUserAsync_WhenCalled_AssertHandleAsyncWasCalledOnExceptionHandler() { IRedditAccessToken redditAccessToken = CreateRedditAccessToken(); IRedditRepository sut = CreateSut(); await sut.GetAuthenticatedUserAsync(redditAccessToken); _exceptionHandlerMock.Verify(m => m.HandleAsync(It.Is <Exception>(exception => exception != null && exception.InnerException == null && exception.GetType() == typeof(UnauthorizedAccessException))), Times.Once()); }
public async Task GetAuthenticatedUserAsync_WhenAccessTokenIsNull_ThrowsArgumentNullException() { IRedditRepository sut = CreateSut(); await sut.GetAuthenticatedUserAsync(null); }