public ActionResult CookiesConcentClosed() { // Get current settings var settings = _userSettingsService.Get(); // Set new value settings.CookiesConcentClosed = true; // Save settings _userSettingsService.Set(settings); return(Json("true")); }
/// <summary> /// Constructor /// </summary> private LayoutViewModel() { using (var db = new DataService()) { Categories = db.GetGateoriesCounters(); Archives = db.GetArchives(); User = UserService.Get(db); UserSettings = UserSettingsService.Get(); } }
public async Task Save_AllSettingTrue_GetReturnsSameResult(bool vibroEnabled, bool soundsEnabled) { //arrange var userSettingsService = new UserSettingsService(_cache, _webService, _toastService); var settings = await userSettingsService.Get(); settings.IsSoundsEnabled = soundsEnabled; settings.IsVibroEnabled = vibroEnabled; //act await userSettingsService.Save(settings); //assert var newSettings = await userSettingsService.Get(); Assert.True(newSettings.IsVibroEnabled == vibroEnabled); Assert.True(newSettings.IsSoundsEnabled == soundsEnabled); }
public JsonResult SetDyslexicFont() { // Get current settings var settings = UserSettingsService.Get(); // Set new value settings.UseDyslexicFont = true; // Save settings UserSettingsService.Set(settings); return(Json(settings.LayoutContentUrl)); }
private static AccessibilitySettings GetAccessibilityModel() { // Get current settings var settings = UserSettingsService.Get(); AccessibilitySettings model = new AccessibilitySettings { UseDyslexicFont = settings.UseDyslexicFont }; return(model); }
public async Task Remove_SettingsWasChanged_GetReturnDefaultSettings(bool vibroEnabled, bool soundsEnabled) { //arrange var userSettingsService = new UserSettingsService(_cache, _webService, _toastService); var settings = await userSettingsService.Get(); settings.IsSoundsEnabled = soundsEnabled; settings.IsVibroEnabled = vibroEnabled; //act await userSettingsService.Save(settings); await userSettingsService.Remove(); //assert var newSettings = await userSettingsService.Get(); Assert.True(newSettings.IsVibroEnabled); Assert.True(newSettings.IsSoundsEnabled); }