protected override void Context() { _view = A.Fake <IApplicationSettingsView>(); _dialogCreator = A.Fake <IDialogCreator>(); _applicationSettings = new ApplicationSettings(); _speciesRepository = A.Fake <ISpeciesRepository>(); A.CallTo(() => _speciesRepository.All()).Returns(new[] { new Species { Name = "Dog", Id = "Dog" }, new Species { Name = "Human", Id = "Human" }, new Species { Name = "Rat", Id = "Rat" } }); _speciesDatabaseDTOMapper = new SpeciesDatabaseMapToSpeciesDatabaseMapDTOMapper(_speciesRepository, new RepresentationInfoRepositoryForSpecs()); _applicationSettingsPersistor = A.Fake <IApplicationSettingsPersistor>(); sut = new ApplicationSettingsPresenter(_view, _applicationSettings, _speciesRepository, _speciesDatabaseDTOMapper, _dialogCreator, _applicationSettingsPersistor); A.CallTo(() => _view.BindTo(A <ApplicationSettingsDTO> ._)) .Invokes(x => _dto = x.GetArgument <ApplicationSettingsDTO>(0)); }
public ApplicationSettingsPresenter(IApplicationSettingsView view, IApplicationSettings applicationSettings, IDialogCreator dialogCreator) : base(view) { _applicationSettings = applicationSettings; _dialogCreator = dialogCreator; _applicationSettingsDTO = new ApplicationSettingsDTO(_applicationSettings); _view.BindTo(_applicationSettingsDTO); }
public void SaveSettings(ApplicationSettingsDTO applicationSettingsDTO) { var fileReadingLibrarySettings = new FileReadingLibrarySettings() { LoggedUserId = applicationSettingsDTO.UserId }; this.fileReadingLibrarySettingsRepository.Update(fileReadingLibrarySettings); }
public ApplicationSettingsPresenter(IApplicationSettingsView view, IApplicationSettings applicationSettings, ISpeciesRepository speciesRepository, ISpeciesDatabaseMapToSpeciesDatabaseMapDTOMapper speciesMapper, IDialogCreator dialogCreator, IApplicationSettingsPersistor applicationSettingsPersistor) : base(view) { _applicationSettings = applicationSettings; _speciesRepository = speciesRepository; _speciesMapper = speciesMapper; _dialogCreator = dialogCreator; _applicationSettingsPersistor = applicationSettingsPersistor; _applicationSettingsDTO = mapFrom(applicationSettings); }
public void Setup() { // mock the settings here var applicationOptions = new ApplicationSettingsDTO() { JWT_Secret = "1234567890123456", Client_URL = "http://localhost:4200/" }; _options = Options.Create(applicationOptions); var user = new ApplicationUser(); }
public ActionResult Start(ApplicationSettingsDTO applicationSettingsDTO) { try { this.settingService.SaveSettings(applicationSettingsDTO); return(RedirectToAction("Index", "File")); } catch { return(View()); } }
// GET: Setting/Index public ActionResult Start() { var applicationSettingsDTO = new ApplicationSettingsDTO(); ViewBag.Users = this.settingService.GetUsers() .Select(x => new SelectListItem() { Text = x.Username, Value = x.Id.ToString() }); return(View(applicationSettingsDTO)); }
public void BindTo(ApplicationSettingsDTO applicationSettings) { _screenBinder.BindToSource(applicationSettings); }
public RegistrationService(UserManager <ApplicationUser> userManager, IOptions <ApplicationSettingsDTO> appSettings) { _userManager = userManager; _appSettings = appSettings.Value; }