本文整理汇总了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()))
);
}
示例2: BinaryTrees
public void BinaryTrees()
{
using (var test = new ComparisonTest(@"TestCases\BinaryTrees.cs")) {
test.Run();
test.Run("8");
}
}
示例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();
}
示例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();
}
示例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();
}
示例6: CastingFromNull
public void CastingFromNull()
{
using (var test = new ComparisonTest(@"TestCases\CastingFromNull.cs"))
{
test.Run();
}
}
示例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();
}
示例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");
}
示例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();
}
示例10: StaticArrays
public void StaticArrays()
{
using (var test = new ComparisonTest(@"TestCases\StaticArrayInitializer.cs"))
test.Run();
}
示例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");
}
}
示例12: ValueTypeMethods
public void ValueTypeMethods()
{
using (var test = new ComparisonTest(@"TestCases\ValueTypeMethods.cs"))
test.Run();
}
示例13: Switch
public void Switch()
{
using (var test = new ComparisonTest(@"TestCases\Switch.cs"))
test.Run();
}
示例14: Goto
public void Goto()
{
using (var test = new ComparisonTest(@"TestCases\Goto.cs"))
test.Run();
}
示例15: FaultBlock
public void FaultBlock()
{
using (var test = new ComparisonTest(@"TestCases\FaultBlock.cs"))
test.Run();
}