当前位置: 首页>>代码示例>>C#>>正文


C# Parser.GetIsComplete方法代码示例

本文整理汇总了C#中Parser.GetIsComplete方法的典型用法代码示例。如果您正苦于以下问题:C# Parser.GetIsComplete方法的具体用法?C# Parser.GetIsComplete怎么用?C# Parser.GetIsComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parser的用法示例。


在下文中一共展示了Parser.GetIsComplete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test_ReadValidCSharpName_Succeeds

        public void Test_ReadValidCSharpName_Succeeds()
        {
            var names = new[]
                {
                    @"Foo",
                    @"foo",
                    @"A",
                    @"a",
                    @"_x",
                    @"x_x",
                    @"_2",
                    @"A5",
                    @"B_5_d",
                    @"B5_d_s_",
                };

            foreach (var name in names)
            {
                var parser = new Parser();
                parser.CallReset(name);
                var result = parser.CallReadValidCSharpName();
                Assert.AreEqual(name, result);
                Assert.IsTrue(parser.GetIsComplete());

                var parser2 = new Parser();
                parser2.CallReset("\t " + name + " \r \t");
                var result2 = parser2.CallReadValidCSharpName();
                Assert.AreEqual(name, result2);
                Assert.IsFalse(parser2.GetIsComplete());
            }
        }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:31,代码来源:MvxParserTest.cs

示例2: DoReadEnumerationTest

 private void DoReadEnumerationTest(Type enumerationType, string input, object expectedOutput)
 {
     var parser = new Parser();
     parser.CallReset(input);
     var output = parser.CallReadEnumerationValue(enumerationType, true /* ignoreCase */);
     Assert.AreEqual(expectedOutput, output);
     Assert.IsTrue(parser.GetIsComplete());
 }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:8,代码来源:MvxParserTest.cs

示例3: Test_CallReadUnsignedInteger_Reads_Numbers

        public void Test_CallReadUnsignedInteger_Reads_Numbers()
        {
            var testStrings = new Dictionary<string, uint>
                {
                    {"2", 2},
                    {"1234", 1234},
                    {UInt32.MaxValue.ToString(), UInt32.MaxValue},
                    {UInt32.MinValue.ToString(), UInt32.MinValue},
                };

            foreach (var testString in testStrings)
            {
                var tokeniser = new Parser();
                tokeniser.CallReset(testString.Key);
                var result = tokeniser.CallReadUnsignedInteger();
                Assert.AreEqual(testString.Value, result);
                Assert.IsTrue(tokeniser.GetIsComplete());
            }
        }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:19,代码来源:MvxParserTest.cs

示例4: DoReadValueTest

 private void DoReadValueTest(string input, object expectedOutput)
 {
     var parser = new Parser();
     parser.CallReset(input);
     var output = parser.CallReadValue();
     Assert.AreEqual(expectedOutput, output);
     Assert.IsTrue(parser.GetIsComplete());
 }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:8,代码来源:MvxParserTest.cs

示例5: Test_CallReadQuotedString_Reads_Strings

        public void Test_CallReadQuotedString_Reads_Strings()
        {
            var testStrings = new Dictionary<string, string>
                {
                    {"''", ""},
                    {"\"Hello \\\"\\\'\"", "Hello \"\'"},
                    {"\"Hello\"", "Hello"},
                    {"'Hello'", "Hello"},
                    {"'Hello World'", "Hello World"},
                    {"'Hello \\r'", "Hello \r"},
                    {"'Hello \\u1234'", "Hello \u1234"},
                    {"'Hello \\U00001234'", "Hello \U00001234"},
                };

            foreach (var testString in testStrings)
            {
                var tokeniser = new Parser();
                tokeniser.CallReset(testString.Key);
                var result = tokeniser.CallReadQuotedString();
                Assert.AreEqual(testString.Value, result);
                Assert.IsTrue(tokeniser.GetIsComplete());
            }
        }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:23,代码来源:MvxParserTest.cs


注:本文中的Parser.GetIsComplete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。