public AccountSettingsViewModel(IAccountRepository accountRepo, ILoggedInUser user, IMapper mapper)
 {
     _accountRepo = accountRepo;
     _user        = user;
     _mapper      = mapper;
     User         = _user.GetUser();
 }
        public void TestInitializer()
        {
            // initialize fake context
            _fakeContext = InitializeFakeContext<FacilitiesController>();

            // explicitly create fake dependencies that need to be intercepted
            //  (all other fake dependencies will be implicitly created by _fakeContext.Resolve<>)
            _fakeBusinessFacade = A.Fake<IBusinessFacade>();
            _fakeLoadedSubscriber = A.Fake<ILoadedSubscriber>();
            _fakeCurrentLocation = A.Fake<ILoadedLocation>();
            _fakeCurrentUser = A.Fake<ILoggedInUser>();
            _fakePermissions = A.Fake<IPermissions>();

            // provide fake dependencies to context
            _fakeContext.Provide(_fakeBusinessFacade);
            _fakeContext.Provide(_fakeLoadedSubscriber);
            _fakeContext.Provide(_fakeCurrentLocation);
            _fakeContext.Provide(_fakeCurrentUser);
            _fakeContext.Provide(_fakePermissions);

            // create system-under-test instance
            _facilitiesControllerForTest = _fakeContext.Resolve<FacilitiesController>();

            // create fake data
            _usiForTest = TestDataRepository.GetUsiForTest();
            _locationIdForTest = TestDataRepository.GetLocationIdForTest();
            _serviceAddressControlNumberForTests = TestDataRepository.GetServiceAddressControlNumberForTest();
            _dpiRegionForTests = TestDataRepository.GetDpiRegionForTest();
        }
예제 #3
0
 public AccountRechargeViewModel(IEventAggregator events,
                                 IAccountRepository accountRepo, ILoggedInUser user)
 {
     _events      = events;
     _accountRepo = accountRepo;
     _user        = user;
 }
예제 #4
0
 public MovieRentViewModel(ILoggedInUser user, IVideoRentalRepository rentalRepo,
                           IAccountRepository accountRepo)
 {
     _user        = user;
     _rentalRepo  = rentalRepo;
     _accountRepo = accountRepo;
 }
예제 #5
0
 public MoviesViewModel(SimpleContainer container, ILoggedInUser userService, IVideoRepository videoRepo, IMapper mapper)
 {
     _container   = container;
     _userService = userService;
     _videoRepo   = videoRepo;
     _mapper      = mapper;
 }
 public AccountRentalHistoryViewModel(SimpleContainer container, IMapper mapper,
                                      IVideoRentalRepository rentalsRepo, ILoggedInUser user)
 {
     _container   = container;
     _rentalsRepo = rentalsRepo;
     _mapper      = mapper;
     _user        = user;
 }
 public AccountLibraryViewModel(SimpleContainer container, IVideoRentalRepository rentalRepo,
                                IMapper mapper, ILoggedInUser user, IWindowManager windowManager)
 {
     _container     = container;
     _windowManager = windowManager;
     _rentalRepo    = rentalRepo;
     _user          = user;
     _mapper        = mapper;
 }
 public ShellViewModel(IEventAggregator events,
                       ILoggedInUser user,
                       IAPIHelper apiHelper)
 {
     _events    = events;
     _user      = user;
     _apiHelper = apiHelper;
     _events.SubscribeOnPublishedThread(this);
     ActivateItemAsync(IoC.Get <LoginViewModel>(), new CancellationToken());
 }
 internal ProvisioningServiceClientProxy(IMappingEngine mapper, ILoggedInUser loggedInUser)
 {
     _mapper = mapper;
     _user = new User
     {
         Email = loggedInUser.Email(),
         Name = loggedInUser.Name(),
         Role = loggedInUser.Role()
     };
 }
예제 #10
0
 public MainViewModel(SimpleContainer container, IWindowManager windowManager,
                      IEventAggregator eventAggregator, ILoggedInUser user)
 {
     _container     = container;
     _windowManager = windowManager;
     _user          = user;
     _events        = eventAggregator;
     _events.Subscribe(this);
     MovieRentalLibraryShow();
 }
예제 #11
0
        public BuyerController(ILoggedInUser loggedInUser, IDomainService domainService, IUserService userService)
        {
            Guard.WhenArgument(loggedInUser, nameof(ILoggedInUser)).IsNull().Throw();
            Guard.WhenArgument(domainService, nameof(IDomainService)).IsNull().Throw();
            Guard.WhenArgument(userService, nameof(IUserService)).IsNull().Throw();

            this.loggedInUser  = loggedInUser;
            this.domainService = domainService;
            this.userService   = userService;
        }
예제 #12
0
 public AccountViewModel(SimpleContainer simpleContainer, ILoggedInUser userService,
                         IWindowManager windowManager, IEventAggregator events)
 {
     _container     = simpleContainer;
     _userService   = userService;
     _windowManager = windowManager;
     _events        = events;
     _events.Subscribe(this);
     UserLibraryShow();
 }
예제 #13
0
 public ShellViewModel(CheckInViewModel checkInVM,
                       IEventAggregator events,
                       ILoggedInUser user,
                       IAPIHelper apiHelper)
 {
     _checkInVM = checkInVM;
     _events    = events;
     _user      = user;
     _apiHelper = apiHelper;
     _events.Subscribe(this);
     ActivateItem(IoC.Get <LoginViewModel>());
 }
예제 #14
0
 private void InitiateFormInfo(string loginError)
 {
     if (!string.IsNullOrEmpty(loginError))
     {
         MessageBox.Show(loginError);
     }
     else
     {
         m_LoggedInUser        = FacebookLogic.LoggedInUser;
         Text                  = string.Format("Mini Facebook - {0}", m_LoggedInUser.Name);
         connectionButton.Text = "Log Out";
     }
 }
 internal CustomerInformationInquiryClientProxy(IDataAccessService dataAccessService, 
                                                 IMappingEngine mapper,
                                                 ILoadedLocation loadedLocation,
                                                 ILoggedInUser loggedInUser)
 {
     _dataAccessService = dataAccessService;
     _mapper = mapper;
     _headerArgs = new HeaderArgs
     (
         loadedLocation.DpiRegion(),
         loggedInUser.Name(),
         string.Empty,
         loggedInUser.Name(),
         loggedInUser.Email(),
         loggedInUser.Role()
     );
 }
예제 #16
0
        public MainViewModel(DashboardViewModel dashboardViewModel,
                             SimpleContainer simpleContainer,
                             IAPIHelper apiHelper,
                             IWindowManager windowManager,
                             ILoggedInUser loggedInUser,
                             IEventAggregator events)
        {
            _dashboardViewModel = dashboardViewModel;
            _simpleContainer    = simpleContainer;
            _apiHelper          = apiHelper;
            _windowManager      = windowManager;
            _loggedInUser       = loggedInUser;
            _events             = events;

            _events.SubscribeOnPublishedThread(this);

            // Initiate the View
            GetLoginViewModel();
        }
예제 #17
0
        public async Task GetLoggedInUserAsync(string token)
        {
            _apiClient.DefaultRequestHeaders.Clear();
            _apiClient.DefaultRequestHeaders.Accept.Clear();
            _apiClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
            _apiClient.DefaultRequestHeaders.Add("Authorization", $"bearer {token}");

            using (HttpResponseMessage response = await _apiClient.GetAsync("/api/User"))
            {
                if (response.IsSuccessStatusCode)
                {
                    var result = JsonConvert.DeserializeObject <LoggedInUser>(await response.Content.ReadAsStringAsync());

                    _loggedInUser = result;
                }
                else
                {
                    throw new Exception(response.ReasonPhrase);
                }
            }
        }
예제 #18
0
 public LoginViewModel(ILoggedInUser userService, IEventAggregator eventAggregator)
 {
     _userService = userService;
     _events      = eventAggregator;
 }
 public ProductsController(ILoggedInUser loggedInUser)
 {
     _loggedInUser = loggedInUser;
 }
예제 #20
0
 public CaffFileService(ApplicationDbContext context, ILoggedInUser userManager, IWebHostEnvironment env)
 {
     UserManager = userManager;
     Context     = context;
     Env         = env;
 }
 public CheckoutController(ILoggedInUser loggedInUser, ISaveToDatabase saveToDatabase)
 {
     _loggedInUser   = loggedInUser;
     _saveToDatabase = saveToDatabase;
 }
예제 #22
0
 public APIHelper(ILoggedInUser loggedInUser)
 {
     InitializeClient();
     _loggedInUser = loggedInUser;
 }
예제 #23
0
 public ApiContext(DbContextOptions <ApiContext> options, ILoggedInUser loggedInUser)
     : base(options)
 {
     _loggedInUser = loggedInUser;
 }
예제 #24
0
 public UserService(ApplicationDbContext context,
                    ILoggedInUser userManager)
 {
     UserManager = userManager;
     Context     = context;
 }
 public MovieMakeReviewViewModel(IEventAggregator events, IReviewsRepository reviewsRepo, ILoggedInUser user)
 {
     _events      = events;
     _reviewsRepo = reviewsRepo;
     _user        = user;
 }