コード例 #1
0
ファイル: Example.cs プロジェクト: Udellgames/ControlStrings
            public Person(Pronoun pronouns)
            {
                Pronouns = pronouns;

                Matchers = new ControlStringMatcherCollection(new List <IControlStringMatcher>()
                {
                    new ContextControlStringMatcher("Pronoun", Pronouns),
                    new ValueControlStringMatcher("Prefix", () => prefix),
                    new ValueControlStringMatcher("Postfix", () => postfix),
                    new ValueControlStringMatcher("Rank", () => rank),
                    new ValueControlStringMatcher("Name", () => name),
                    new ValueControlStringMatcher("FullName", () => FullName)
                });

                parser = new Parser(new ControlStringFinder('{', ':', '}', '[', ']', '|'), Matchers, new NullTransformer());
            }
コード例 #2
0
 public void Matches_WhenControlStringIsNull_ThrowsArgumentNullException(ControlStringMatcherCollection unit)
 {
     Should.Throw <ArgumentNullException>(() => unit.Matches(null));
 }