Пример #1
0
        public static void ValidateOptions(NotificationOptions options)
        {
            Dictionary <string, INotificationClient> clients = options.Clients;

            foreach (var client in clients)
            {
                var isOptionsValid = true;
                switch (client.Value.Options.Type)
                {
                case "slack":
                    isOptionsValid = SlackClient.IsOptionsValid(client.Value.Options);
                    break;

                default:
                    throw new Exception("Type " + client.Value.Options.Type + " is not supported.");
                }
                if (!isOptionsValid)
                {
                    throw new Exception("Failed to validate client options for " + client.Value.Options.Type + ".");
                }
            }
        }