public void Remove_RemovesAddedInstance() { var c = new InputConfiguration(); provider.AddOrUpdate(c); Assert.AreEqual(1, provider.Configs.Count()); provider.Remove(c); Assert.AreEqual(0, provider.Configs.Count()); }
public void Execute() { var config = inputConfigProvider.FindConfigForName(configName); if (config == null) { Result = new ApiResult <Object> { Content = "Fail", Success = false, Message = "Fail", ErrorMessage = $"Input configuration with name {configName} was not found" }; return; } try { if (config.HasView) { // TODO: Remove view folder and files and media } storageProvider.RemoveInputConfiguration(config); inputConfigProvider.Remove(config); Result = new ApiResult <Object> { Content = "OK", Success = true, Message = "Ok" }; } catch (Exception e) { Result = new ApiResult <Object> { Success = false, Message = "Failed to remove configuration " + configName, ErrorMessage = e.Message }; } }