public IEnumerable <RuleData> ExtractRuleData(IUnit jobnet)
        {
            foreach (var sdParam in jobnet.Parameters.Where(x => x.Name == "sd"))
            {
                var d = new RuleData();

                d.Number  = sdParam.Values.Count == 1 ? 1 : int.Parse(sdParam.Values[0].StringValue);
                d.SdParam = SdParamData.Create(sdParam.Values[sdParam.Values.Count - 1].StringValue);
                d.StParam = jobnet.ParameterNvl("st", d.Number, x => StParamData.Create(x.StringValue), StParamData.Default);
                d.CyParam = jobnet.ParameterNvl("cy", d.Number, x => CyParamData.Create(x.TupleValue), null);
                d.WcParam = jobnet.ParameterNvl("wc", d.Number, x => WcParamData.Create(x.StringValue), WcParamData.Default);
                d.WtParam = jobnet.ParameterNvl("wt", d.Number, x => WtParamData.Create(x.StringValue), WtParamData.Default);

                yield return(d);
            }
        }
        public void Create_Case21_1_w()
        {
            // Arrange
            var tpl = MutableTuple.Empty;

            tpl.Add("1");
            tpl.Add("w");

            // Act
            var pd = CyParamData.Create(tpl);

            // Assert
            Assert.That(pd.RawData, Is.EqualTo("(1,w)"));
            Assert.That(pd.Interval, Is.EqualTo(1));
            Assert.That(pd.Unit, Is.EqualTo(CyParamData.CyUnits.Week));
            Assert.That(pd.ToString(), Is.EqualTo("1週間ごと"));
        }
        public void Create_Case12_10_m()
        {
            // Arrange
            var tpl = MutableTuple.Empty;

            tpl.Add("10");
            tpl.Add("m");

            // Act
            var pd = CyParamData.Create(tpl);

            // Assert
            Assert.That(pd.RawData, Is.EqualTo("(10,m)"));
            Assert.That(pd.Interval, Is.EqualTo(10));
            Assert.That(pd.Unit, Is.EqualTo(CyParamData.CyUnits.Month));
            Assert.That(pd.ToString(), Is.EqualTo("10ヶ月ごと"));
        }