コード例 #1
0
        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());
        }
コード例 #2
0
        public async Task GetAuthenticatedUserAsync_WhenAccessTokenIsNull_ThrowsArgumentNullException()
        {
            IRedditRepository sut = CreateSut();

            await sut.GetAuthenticatedUserAsync(null);
        }