コード例 #1
0
        public void IndentationCharacterValidationShouldValidateEmptyLine()
        {
            IndentationCharacterValidationRule rule = new IndentationCharacterValidationRule(true, true);

            Line aLine = new Line(new TokenBase[] {});

            Assert.IsTrue(rule.IsValidFor(aLine));
        }
コード例 #2
0
        public void IndentationCharacterValidationShouldValidateLine()
        {
            IndentationCharacterValidationRule rule = new IndentationCharacterValidationRule(true, true);

            Line aLine = new Line(new[] { TokenCreator.Create <IdentifierToken>("test") });

            Assert.IsTrue(rule.Validates(aLine));
        }
コード例 #3
0
        public void IndentationCharacterValidationShouldCorrectlyValidateSpacesAndTabs()
        {
            IndentationCharacterValidationRule rule = new IndentationCharacterValidationRule(true, true);

            IList <TokenBase> input = new List <TokenBase>();

            input.Add(TokenCreator.Create <TabToken>());
            input.Add(TokenCreator.Create <SpaceToken>());
            input.Add(TokenCreator.Create <IdentifierToken>("test"));

            Line aLine = new Line(input);

            Assert.IsTrue(rule.IsValidFor(aLine));
        }