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(); }
public AccountRechargeViewModel(IEventAggregator events, IAccountRepository accountRepo, ILoggedInUser user) { _events = events; _accountRepo = accountRepo; _user = user; }
public MovieRentViewModel(ILoggedInUser user, IVideoRentalRepository rentalRepo, IAccountRepository accountRepo) { _user = user; _rentalRepo = rentalRepo; _accountRepo = accountRepo; }
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() }; }
public MainViewModel(SimpleContainer container, IWindowManager windowManager, IEventAggregator eventAggregator, ILoggedInUser user) { _container = container; _windowManager = windowManager; _user = user; _events = eventAggregator; _events.Subscribe(this); MovieRentalLibraryShow(); }
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; }
public AccountViewModel(SimpleContainer simpleContainer, ILoggedInUser userService, IWindowManager windowManager, IEventAggregator events) { _container = simpleContainer; _userService = userService; _windowManager = windowManager; _events = events; _events.Subscribe(this); UserLibraryShow(); }
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>()); }
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() ); }
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(); }
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); } } }
public LoginViewModel(ILoggedInUser userService, IEventAggregator eventAggregator) { _userService = userService; _events = eventAggregator; }
public ProductsController(ILoggedInUser loggedInUser) { _loggedInUser = loggedInUser; }
public CaffFileService(ApplicationDbContext context, ILoggedInUser userManager, IWebHostEnvironment env) { UserManager = userManager; Context = context; Env = env; }
public CheckoutController(ILoggedInUser loggedInUser, ISaveToDatabase saveToDatabase) { _loggedInUser = loggedInUser; _saveToDatabase = saveToDatabase; }
public APIHelper(ILoggedInUser loggedInUser) { InitializeClient(); _loggedInUser = loggedInUser; }
public ApiContext(DbContextOptions <ApiContext> options, ILoggedInUser loggedInUser) : base(options) { _loggedInUser = loggedInUser; }
public UserService(ApplicationDbContext context, ILoggedInUser userManager) { UserManager = userManager; Context = context; }
public MovieMakeReviewViewModel(IEventAggregator events, IReviewsRepository reviewsRepo, ILoggedInUser user) { _events = events; _reviewsRepo = reviewsRepo; _user = user; }