コード例 #1
0
        private JaRomajiTagGeneratorConfig generatorConfig(params string[] properties)
        {
            var config = new JaRomajiTagGeneratorConfig();

            if (properties == null)
            {
                return(config);
            }

            foreach (var propertyName in properties)
            {
                if (propertyName == null)
                {
                    continue;
                }

                var theMethod = config.GetType().GetProperty(propertyName);
                if (theMethod == null)
                {
                    throw new MissingMethodException("Config is not exist.");
                }

                theMethod.SetValue(config, true);
            }

            return(config);
        }
コード例 #2
0
        protected void RunRomajiCheckTest(string text, string[] actualRomaji, JaRomajiTagGeneratorConfig config)
        {
            var generator = new JaRomajiTagGenerator(config);

            var lyric = new Lyric {
                Text = text
            };
            var romajiTags       = generator.CreateRomajiTags(lyric);
            var actualRomajiTags = TestCaseTagHelper.ParseRomajiTags(actualRomaji);

            TextTagAssert.ArePropertyEqual(romajiTags, actualRomajiTags);
        }