public void AddOrUpdate_AddsWhenNewInstance() { var c = new InputConfiguration(); provider.AddOrUpdate(c); Assert.AreEqual(1, provider.Configs.Count()); Assert.AreEqual(c, provider.Configs.First()); }
public void Execute() { try { SaveToStorage(); CreateViewFolderIfNeeded(); CreateMediaFolder(); inputConfigProvider.AddOrUpdate(configuration); Result = new ApiResult <object> { Content = "empty", Success = true, Message = "Ok" }; } catch (Exception e) { Result = new ApiResult <object> { Content = "empty", Success = false, Message = "Failed to save input configuration " + configuration.Name, ErrorMessage = e.Message }; } }
private void SaveConfigurations(IEnumerable <InputConfiguration> configurations, ZipFile zip) { foreach (var configuration in configurations) { inputConfigProvider.AddOrUpdate(configuration); storageProvider.SaveInputConfiguration(configuration); if (configuration.HasView) { SaveView(zip, appConfigProvider.AppConfig.WebRoot); } SaveMedia(zip, appConfigProvider.AppConfig.WebRoot); } }