コード例 #1
0
        public async Task ActivateUserAccount_WithInvalidToken_ReturnsAccountActivationFailedView()
        {
            // Arrange
            IWeeeClient apiClient = A.Fake <IWeeeClient>();

            A.CallTo(() => apiClient.User.ActivateUserAccountEmailAsync(A <ActivatedUserAccountData> ._, A <string> ._))
            .Returns(false);

            IWeeeAuthorization    weeeAuthorization    = A.Dummy <IWeeeAuthorization>();
            IExternalRouteService externalRouteService = A.Dummy <IExternalRouteService>();

            var controller = new AccountController(() => apiClient, weeeAuthorization, externalRouteService, () => oauthClientCredentialClient);

            // Act
            var result = await controller.ActivateUserAccount(new Guid("EF565DF2-DC16-4589-9CE4-B29568B3E274"), "code");

            // Assert
            ViewResult viewResult = result as ViewResult;

            Assert.NotNull(viewResult);

            Assert.Equal("AccountActivationFailed", viewResult.ViewName);
        }