public void TransmissionModeTests(ChannelSources src, TransmissionModes val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "T" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.TransmissionMode);
            Assert.AreEqual(val.Equals(TransmissionModes.TRANSMISSION_MODE_AUTO) ? string.Empty : text, parameters.ToString());
        }
        public void SM_modeTests(ChannelSources src, SISO_MISO_Modes val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "X" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.SM_mode);
            Assert.AreEqual(text, parameters.ToString());
        }
        public void PilotModeTests(ChannelSources src, PilotModes val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "N" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.PilotMode);
            Assert.AreEqual(val.Equals(PilotModes.PILOT_AUTO) ? string.Empty : text, parameters.ToString());
        }
        public void RollOffTests(ChannelSources src, Rolloffs val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "O" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.Rolloff);
            Assert.AreEqual(val.Equals(Rolloffs.ROLLOFF_AUTO) ? string.Empty : text, parameters.ToString());
        }
        public void ModulationTests(ChannelSources src, Modulations val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "M" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.Modulation);
            Assert.AreEqual(val.Equals(Modulations.QAM_AUTO) ? string.Empty : text, parameters.ToString());
        }
        public void PolarizationTests(ChannelSources src, short val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "I" + val.ToString();

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.Inversion);
            Assert.AreEqual(text, parameters.ToString());
        }
        public void HierarchyTests(ChannelSources src, Hierarchies val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "Y" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.Hierarchy);
            Assert.AreEqual(val.Equals(Hierarchies.HIERARCHY_AUTO) ? string.Empty : text, parameters.ToString());
        }
        public void DeliverySystemTests(ChannelSources src, DeliverySystems val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "S" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.DeliverySystem);
            Assert.AreEqual(text, parameters.ToString());
        }
        public void GuardIntervalTests(ChannelSources src, GuardIntervals val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "G" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.GuardInterval);
            Assert.AreEqual(val.Equals(GuardIntervals.GUARD_INTERVAL_AUTO) ? string.Empty : text, parameters.ToString());
        }
        public void CoderateLowPriorityTests(ChannelSources src, CoderateValues val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "D" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.CodeRateLowPriority);
            Assert.AreEqual(val.Equals(CoderateValues.FEC_AUTO) ? string.Empty : text, parameters.ToString());
        }
        public void BandwidthTests(ChannelSources src, BandwidthValues val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "B" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.Bandwidth);
            Assert.AreEqual(text, parameters.ToString());
        }
        public void EvaluateParametersTest3()
        {
            ParametersField parameters = new ParametersField(ChannelSources.CHANNEL_SOURCE_DVBC);
            string          text       = "C0M64";

            parameters.EvaluateParameters(text);
            Assert.AreEqual(CoderateValues.FEC_NONE, parameters.CodeRateHighPriority);
            Assert.AreEqual(Modulations.QAM_64, parameters.Modulation);
            string errorMessage = string.Empty;
            bool   retVal       = Helper.AreDictsEqual(Helper.SplitParameters(text), Helper.SplitParameters(parameters.ToString()), ref errorMessage);

            Assert.IsTrue(retVal, errorMessage);
        }
        public void T2SystemIdTests(ChannelSources src, int val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "Q" + val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.T2SystemId);
            string temp = string.Empty;

            if (val >= 0 && val <= 65535)
            {
                temp = text;
            }
            Assert.AreEqual(temp, parameters.ToString());
        }
        public void StreamIdTests(ChannelSources src, short val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "P" + val.ToString();

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.StreamId);
            string temp = string.Empty;

            if (val >= 0 && val <= 255)
            {
                temp = text;
            }
            Assert.AreEqual(temp, parameters.ToString());
        }
        public void EvaluateParametersTest5()
        {
            ParametersField parameters = new ParametersField(ChannelSources.CHANNEL_SOURCE_DVBS2);
            string          text       = "HC910M2O35S1";

            parameters.EvaluateParameters(text);
            Assert.AreEqual(Polarizations.H, parameters.Polarization);
            Assert.AreEqual(CoderateValues.FEC_9_10, parameters.CodeRateHighPriority);
            Assert.AreEqual(Modulations.QPSK, parameters.Modulation);
            Assert.AreEqual(Rolloffs.ROLLOFF_35, parameters.Rolloff);
            Assert.AreEqual(DeliverySystems.DVB_SYSTEM_2, parameters.DeliverySystem);
            string errorMessage = string.Empty;
            bool   retVal       = Helper.AreDictsEqual(Helper.SplitParameters(text), Helper.SplitParameters(parameters.ToString()), ref errorMessage);

            Assert.IsTrue(retVal, errorMessage);
        }
        public void EvaluateParametersTest1()
        {
            ParametersField parameters = new ParametersField(ChannelSources.CHANNEL_SOURCE_DVBT);
            string          text       = "B8C23D12G8M16T8Y0S0";

            parameters.EvaluateParameters(text);
            Assert.AreEqual(BandwidthValues.BANDWIDTH_8000000, parameters.Bandwidth);
            Assert.AreEqual(CoderateValues.FEC_2_3, parameters.CodeRateHighPriority);
            Assert.AreEqual(CoderateValues.FEC_1_2, parameters.CodeRateLowPriority);
            Assert.AreEqual(GuardIntervals.GUARD_INTERVAL_1_8, parameters.GuardInterval);
            Assert.AreEqual(Modulations.QAM_16, parameters.Modulation);
            Assert.AreEqual(TransmissionModes.TRANSMISSION_MODE_8k, parameters.TransmissionMode);
            Assert.AreEqual(Hierarchies.HIERARCHY_NONE, parameters.Hierarchy);
            Assert.AreEqual(DeliverySystems.DVB_SYSTEM_1, parameters.DeliverySystem);
            string errorMessage = string.Empty;
            bool   retVal       = Helper.AreDictsEqual(Helper.SplitParameters(text), Helper.SplitParameters(parameters.ToString()), ref errorMessage);

            Assert.IsTrue(retVal, errorMessage);
        }