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


C# ComparisonTest.Run方法代码示例

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


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

示例1: AllSimpleTests

        public void AllSimpleTests()
        {
            var defaultProvider = MakeDefaultProvider();
            var simpleTests = Directory.GetFiles(
                Path.GetFullPath(Path.Combine(ComparisonTest.TestSourceFolder, "SimpleTestCases")),
                "*.cs"
            );
            var failureList = new List<string>();

            foreach (var filename in simpleTests) {
                Console.Write("// {0} ... ", Path.GetFileName(filename));

                try {
                    // We reuse the same type info provider for all the tests in this folder so they run faster
                    using (var test = new ComparisonTest(filename, null, defaultProvider))
                        test.Run();
                } catch (Exception ex) {
                    failureList.Add(Path.GetFileNameWithoutExtension(filename));
                    if (ex.Message == "JS test failed")
                        Debug.WriteLine(ex.InnerException);
                    else
                        Debug.WriteLine(ex);
                }
            }

            Assert.AreEqual(0, failureList.Count,
                String.Format("{0} test(s) failed:\r\n{1}", failureList.Count, String.Join("\r\n", failureList.ToArray()))
            );
        }
开发者ID:robashton,项目名称:JSIL,代码行数:29,代码来源:ComparisonTests.cs

示例2: BinaryTrees

 public void BinaryTrees()
 {
     using (var test = new ComparisonTest(@"TestCases\BinaryTrees.cs")) {
         test.Run();
         test.Run("8");
     }
 }
开发者ID:robashton,项目名称:JSIL,代码行数:7,代码来源:ComparisonTests.cs

示例3: Chars

 public void Chars()
 {
     using (var test = new ComparisonTest(@"TestCases\Chars.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\CharSwitch.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:7,代码来源:ComparisonTests.cs

示例4: Casts

 public void Casts()
 {
     using (var test = new ComparisonTest(@"TestCases\CastToBoolean.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\CastingFromNull.cs"))
         test.Run();
 }
开发者ID:Caspeco,项目名称:JSIL,代码行数:7,代码来源:ComparisonTests.cs

示例5: Arithmetic

 public void Arithmetic()
 {
     using (var test = new ComparisonTest(@"TestCases\IntegerArithmetic.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\TernaryArithmetic.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:7,代码来源:ComparisonTests.cs

示例6: CastingFromNull

 public void CastingFromNull()
 {
     using (var test = new ComparisonTest(@"TestCases\CastingFromNull.cs"))
     {
         test.Run();
     }
 }
开发者ID:robashton,项目名称:JSIL,代码行数:7,代码来源:ComparisonTests.cs

示例7: Enums

 public void Enums()
 {
     using (var test = new ComparisonTest(@"TestCases\Enums.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\EnumArrayLookup.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\EnumSwitch.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\OverloadWithEnum.cs"))
         test.Run();
 }
开发者ID:rozgo,项目名称:JSIL,代码行数:11,代码来源:ComparisonTests.cs

示例8: AllFailingTests

        public void AllFailingTests()
        {
            var testPath = Path.GetFullPath(Path.Combine(ComparisonTest.TestSourceFolder, "FailingTestCases"));
            var simpleTests = Directory.GetFiles(testPath, "*.cs").Concat(Directory.GetFiles(testPath, "*.vb")).ToArray();

            int passCount = 0;

            foreach (var filename in simpleTests) {
                Console.Write("// {0} ... ", Path.GetFileName(filename));

                try {
                    using (var test = new ComparisonTest(filename))
                        test.Run();

                    passCount += 1;
                } catch (Exception ex) {
                    Console.WriteLine("{0}: {1}", ex.GetType().Name, ex.Message);
                }
            }

            Assert.AreEqual(0, passCount, "One or more tests passed that should have failed");
        }
开发者ID:Caspeco,项目名称:JSIL,代码行数:22,代码来源:FailingTests.cs

示例9: StaticConstructors

 public void StaticConstructors()
 {
     using (var test = new ComparisonTest(@"TestCases\GenericStaticConstructorOrdering.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\StaticConstructorOrdering.cs"))
         test.Run();
     using (var test = new ComparisonTest(@"TestCases\StaticInitializersInGenericTypesSettingStaticFields.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:9,代码来源:ComparisonTests.cs

示例10: StaticArrays

 public void StaticArrays()
 {
     using (var test = new ComparisonTest(@"TestCases\StaticArrayInitializer.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:5,代码来源:ComparisonTests.cs

示例11: SwitchStatements

        public void SwitchStatements()
        {
            var defaultProvider = MakeDefaultProvider();

            RunComparisonTests(
                new[] {
                    @"TestCases\Switch.cs",
                    @"TestCases\ComplexSwitch.cs",
                    @"TestCases\CharSwitch.cs",
                    @"TestCases\ContinueInsideSwitch.cs",
                }, null, defaultProvider
            );

            using (var test = new ComparisonTest(@"SpecialTestCases\BigStringSwitch.cs")) {
                test.Run();
                test.Run("howdy", "hello", "world", "what", "why", "who", "where", "when");
            }
        }
开发者ID:secretrobotron,项目名称:JSIL,代码行数:18,代码来源:ComparisonTests.cs

示例12: ValueTypeMethods

 public void ValueTypeMethods()
 {
     using (var test = new ComparisonTest(@"TestCases\ValueTypeMethods.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:5,代码来源:ComparisonTests.cs

示例13: Switch

 public void Switch()
 {
     using (var test = new ComparisonTest(@"TestCases\Switch.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:5,代码来源:ComparisonTests.cs

示例14: Goto

 public void Goto()
 {
     using (var test = new ComparisonTest(@"TestCases\Goto.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:5,代码来源:ComparisonTests.cs

示例15: FaultBlock

 public void FaultBlock()
 {
     using (var test = new ComparisonTest(@"TestCases\FaultBlock.cs"))
         test.Run();
 }
开发者ID:robashton,项目名称:JSIL,代码行数:5,代码来源:ComparisonTests.cs


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