示例#1
0
        public string GetPossibleStrings_WithMultipleTokens(string raw, params ConditionKey[] conditionKeys)
        {
            // arrange
            ConditionFactory    factory    = new ConditionFactory();
            TokenString         tokenStr   = new TokenString(raw, new HashSet <ConditionKey>(conditionKeys), TokenStringBuilder.TokenPattern);
            ConditionDictionary conditions = factory.BuildEmpty();

            // act
            IEnumerable <string> actual = factory.GetPossibleStrings(tokenStr, conditions);

            // assert
            return(this.SortAndCommaDelimit(actual));
        }
示例#2
0
        public void GetPossibleStrings_WithOneToken(ConditionKey condition)
        {
            // arrange
            ConditionFactory factory  = new ConditionFactory();
            TokenString      tokenStr = new TokenString("{{" + condition + "}}", new HashSet <ConditionKey> {
                condition
            }, TokenStringBuilder.TokenPattern);
            ConditionDictionary conditions = factory.BuildEmpty();

            // act
            IEnumerable <string> actual = factory.GetPossibleStrings(tokenStr, conditions);

            // assert
            this.SortAndCommaDelimit(actual).Should().Be(this.CommaDelimitedValues[condition]);
        }