using System;
using Volpe.Cafe.Logging;
using Volpe.Cafe.MarketData.Design;
using Volpe.Cafe.ModelSettings;

namespace Volpe.Cafe.DfsSrModels
{
    [Serializable]
    internal static class ThrowHelper
    {
        /// <summary>
        /// Checks the specified input parameters and throws an <see cref="ArgumentNullException"/> if any of them are
        /// <c>null</c>.
        /// </summary>
        public static void ThrowIfInvalidArgs(IIndustry data, ModelingSettings settings, ILogger logWriter)
        {
            if (data is null) {
                IndustryDataMayNotBeNull();
            }
            if (settings is null) {
                ModelingSettingsMayNotBeNull();
            }
            if (logWriter is null) {
                LogWriterMayNotBeNull();
            }
        }

        /// <summary>
        /// Throws: ArgumentNullException(null, "'data' may not be null.")
        /// </summary>
        internal static void IndustryDataMayNotBeNull()
        {
            throw new ArgumentNullException(null, "'data' may not be null.");
        }

        /// <summary>
        /// Throws: ArgumentNullException(null, "'settings' may not be null.")
        /// </summary>
        internal static void ModelingSettingsMayNotBeNull()
        {
            throw new ArgumentNullException(null, "'settings' may not be null.");
        }

        /// <summary>
        /// Throws: ArgumentNullException(null, "'logWriter' may not be null.")
        /// </summary>
        internal static void LogWriterMayNotBeNull()
        {
            throw new ArgumentNullException(null, "'logWriter' may not be null.");
        }

    }
}
