public void ForOtherClaimIdentifier_ThenNullReturned()
        {
            var handler = new GetUserByClaimId(_userRepo.Object);

            var retrievedUser = handler.Execute("1");

            Assert.Null(retrievedUser);
        }
        public ChartController(GetUserByClaimId getUser, IChartDataService chartDataService, IServiceLocator serviceLocator)
            : base(getUser, serviceLocator)
        {
            if (chartDataService == null)
                throw new ArgumentNullException("chartDataService");

            this.chartDataService = chartDataService;
        }
 public VehicleChartController(
     GetUserByClaimId getUser,
     IChartDataService chartDataService,
     IServiceLocator serviceLocator)
     : base(getUser, serviceLocator)
 {
     this.chartDataService = chartDataService;
 }
 public DashboardController(
     GetUserByClaimId getUser,
     GetCountries getCountries,
     IServiceLocator serviceLocator,
     IChartDataService chartDataService)
     : base(getUser, serviceLocator)
 {
     this.getCountries = getCountries;
     this.chartDataService = chartDataService;
 }
 public AuthController(
     IOpenIdRelyingParty relyingParty, 
     IFormsAuthentication formsAuthentication,
     CreateUser createUser,
     GetUserByClaimId getUserByClaimId)
 {
     _relyingParty = relyingParty;
     _formsAuthentication = formsAuthentication;
     _createUser = createUser;
     _getUserByClaimId = getUserByClaimId;
 }
 public ProfileController(
     UpdateUser updateUser,
     GetUserByClaimId getUser,
     GetCountries getCountries,
     IFormsAuthentication formsAuthentication)
     : base(getUser, null)
 {
     _updateUser = updateUser;
     _getCountries = getCountries;
     _formsAuthentication = formsAuthentication;
 }
        public void ThenUserReturned()
        {
            var user = new User { UserId = 1, DisplayName = "a friendly name" };

            _userRepo
                .Setup(ur => ur.GetByAuthenticatedId("1"))
                .Returns(new User { UserId = 1, DisplayName = "a friendly name" });

            var handler = new GetUserByClaimId(_userRepo.Object);

            var retrievedUser = handler.Execute("1");

            Assert.NotNull(retrievedUser);
            Assert.Equal(user.UserId, retrievedUser.UserId);
        }
 public FillupController(GetUserByClaimId getUser, IServiceLocator serviceLocator)
     : base(getUser, serviceLocator)
 {
 }
 public GetProfileController(GetUserByClaimId getUser)
 {
     this.getUser = getUser;
 }
 public MakeAndModelController(
     GetUserByClaimId getUser,
     IServiceLocator serviceLocator)
     : base(getUser, serviceLocator)
 {
 }
 public SampleController(GetUserByClaimId getUser, IServiceLocator locator)
     : base(getUser, locator)
 {
     _locator = locator;
 }
 public VehiclePhotoController(
     GetUserByClaimId getUser,
     IServiceLocator serviceLocator)
     : base(getUser, serviceLocator)
 {
 }
 public TestableAuthController(IOpenIdRelyingParty mockRelyingParty, IFormsAuthentication formsAuth,
                               CreateUser createUser, GetUserByClaimId getUser)
     : base(mockRelyingParty, formsAuth, createUser, getUser)
 {
 }
        private static TestableAuthController GetTestableAuthController(
            IOpenIdRelyingParty relyingParty,
            IFormsAuthentication formsAuth,
            CreateUser createUser,
            GetUserByClaimId getUser,
            string providerUrl = @"http:\\testprovider.com")
        {
            HttpContextBase contextMock = MvcMockHelpers.FakeHttpContext(providerUrl);
            var authController = new TestableAuthController(relyingParty, formsAuth, createUser, getUser);
            authController.ControllerContext = new ControllerContext(contextMock, new RouteData(), authController);
            authController.InvokeInitialize(authController.ControllerContext.RequestContext);

            // default routes
            var routes = new RouteCollection();
            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new {controller = "Home", action = "Index", id = ""} // Parameter defaults
                );
            authController.Url = new UrlHelper(authController.ControllerContext.RequestContext,
                                               routes);

            return authController;
        }