public FullSettingsViewModelBuilder(UserSettings settings) { _model = new FullSettingsViewModel { AppName = settings.AppName, AutoUpdate = settings.AutoUpdate, EnableRollbarLogging = settings.EnableRollbarLogging, Id = settings.Id, KeepLogsCount = settings.KeepLogsCount, Language = settings.Language, MovieLibraries = settings.MovieLibraries.ToList(), ShowLibraries = settings.ShowLibraries.ToList(), ToShortMovie = settings.ToShortMovie, ToShortMovieEnabled = settings.ToShortMovieEnabled, UpdateInProgress = settings.UpdateInProgress, UpdateTrain = (int)settings.UpdateTrain, WizardFinished = settings.WizardFinished, MediaServer = new MediaServerSettingsViewModel { ServerAddress = settings.MediaServer.ServerAddress, AuthorizationScheme = settings.MediaServer.AuthorizationScheme, ServerPort = settings.MediaServer.ServerPort, ApiKey = settings.MediaServer.ApiKey, ServerName = settings.MediaServer.ServerName, ServerProtocol = (int)settings.MediaServer.ServerProtocol } }; }
public async void IsConfigurationUpdatedCorrectly() { var settings = new FullSettingsViewModel { Id = DeviceId, AppName = "EmbyStat", AutoUpdate = false, KeepLogsCount = 10, Language = "en-US", MovieLibraries = new List <string>(), ShowLibraries = new List <string>(), ToShortMovie = 10, UpdateInProgress = false, UpdateTrain = 0, Username = "******", WizardFinished = true, MediaServer = new FullSettingsViewModel.MediaServerSettingsViewModel { ApiKey = "1234567980", ServerName = "ServerName", AuthorizationScheme = "MediaBrowser", ServerAddress = "localhost", ServerPort = 8097, ServerProtocol = 1, }, Tvdb = new FullSettingsViewModel.TvdbSettingsViewModel { LastUpdate = new DateTime(2019, 1, 1), ApiKey = "ABCDE" } }; await _subject.Update(settings); _settingsServiceMock.Verify(x => x.SaveUserSettingsAsync(It.IsAny <UserSettings>()), Times.Once); }