public AccountControllerTests()
 {
     apiClient = A.Fake<IWeeeClient>();
     unauthenticatedUserClient = A.Fake<IUnauthenticatedUser>();
     weeeAuthorization = A.Fake<IWeeeAuthorization>();
     externalRouteService = A.Fake<IExternalRouteService>();
 }
示例#2
0
 public AccountControllerTests()
 {
     apiClient = A.Fake <IWeeeClient>();
     oauthClientCredentialClient = A.Fake <IOAuthClientCredentialClient>();
     unauthenticatedUserClient   = A.Fake <IUnauthenticatedUser>();
     weeeAuthorization           = A.Fake <IWeeeAuthorization>();
     externalRouteService        = A.Fake <IExternalRouteService>();
 }
示例#3
0
 public AccountControllerTest()
 {
     apiClient             = A.Fake <IWeeeClient>();
     authenticationManager = A.Fake <IAuthenticationManager>();
     oauthClient           = A.Fake <IOAuthClient>();
     userInfoClient        = A.Fake <IUserInfoClient>();
     externalRouteService  = A.Fake <IExternalRouteService>();
 }
 public AccountController(Func<IWeeeClient> apiClient,
     IWeeeAuthorization weeeAuthorization,
     IExternalRouteService externalRouteService)
 {
     this.apiClient = apiClient;
     this.weeeAuthorization = weeeAuthorization;
     this.externalRouteService = externalRouteService;
 }
 public AccountControllerTest()
 {
     apiClient = A.Fake<IWeeeClient>();
     authenticationManager = A.Fake<IAuthenticationManager>();
     oauthClient = A.Fake<IOAuthClient>();
     userInfoClient = A.Fake<IUserInfoClient>();
     externalRouteService = A.Fake<IExternalRouteService>();
 }
示例#6
0
 public NewUserControllerTests()
 {
     oathClient            = A.Fake <IOAuthClient>();
     weeeClient            = A.Fake <IWeeeClient>();
     oathClientCredential  = A.Fake <IOAuthClientCredentialClient>();
     authenticationManager = A.Fake <IAuthenticationManager>();
     externalRouteService  = A.Fake <IExternalRouteService>();
     appConfig             = A.Fake <IAppConfiguration>();
 }
示例#7
0
 public AccountController(Func <IWeeeClient> apiClient,
                          IWeeeAuthorization weeeAuthorization,
                          IExternalRouteService externalRouteService, Func <IOAuthClientCredentialClient> apiClientCredential)
 {
     this.apiClient            = apiClient;
     this.weeeAuthorization    = weeeAuthorization;
     this.externalRouteService = externalRouteService;
     this.apiClientCredential  = apiClientCredential;
 }
 public AccountController(
     Func<IWeeeClient> apiClient,
     IAuthenticationManager authenticationManager,
     IExternalRouteService externalRouteService,
     IWeeeAuthorization weeeAuthorization)
 {
     this.apiClient = apiClient;
     this.authenticationManager = authenticationManager;
     this.externalRouteService = externalRouteService;
     this.weeeAuthorization = weeeAuthorization;
 }
示例#9
0
 public NewUserController(Func <IOAuthClient> oauthClient,
                          Func <IWeeeClient> apiClient,
                          IAuthenticationManager authenticationManager,
                          IExternalRouteService externalRouteService,
                          IAppConfiguration appConfig,
                          Func <IOAuthClientCredentialClient> oauthClientCredential)
 {
     this.oauthClient           = oauthClient;
     this.apiClient             = apiClient;
     this.authenticationManager = authenticationManager;
     this.externalRouteService  = externalRouteService;
     this.appConfig             = appConfig;
     this.oauthClientCredential = oauthClientCredential;
 }
示例#10
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);
        }