本文整理汇总了C#中System.Test.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Test.Run方法的具体用法?C# Test.Run怎么用?C# Test.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Test
的用法示例。
在下文中一共展示了Test.Run方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DollarSignInAssertForPropertyGetters
public void DollarSignInAssertForPropertyGetters()
{
var t = new Test {
Member = "QuickTest.Tests.RunTests+Person.Personality",
ThisString = "{ Personality:20 }",
AssertString = "$ > 15 && $ < 30",
TestType = TestType.PropertyGetter,
};
t.Run ();
Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
}
示例2: ProcedureAssert
public void ProcedureAssert()
{
var t = new Test {
Member = "QuickTest.Tests.RunTests+Person.LowerCase",
ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
AssertString = "FullName == \"frank krueger\"",
TestType = TestType.Procedure,
};
t.Run ();
Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
}
示例3: ObjectLiteralArgs
public void ObjectLiteralArgs()
{
var t = new Test {
Member = "QuickTest.Tests.RunTests+Person.SetLocation",
ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
AssertString = "Location.Lat == 1.0",
TestType = TestType.Procedure,
};
t.Arguments.Add (new TestArgument { Name = "loc", ValueString = "{Lat=1,Lon=2}", ValueType = "QuickTest.Tests.RunTests+Location", });
t.Run ();
Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
}
示例4: Main
static void Main()
{
using (var game = new Test())
game.Run();
}
示例5: PropertyGetterBadAssert
public void PropertyGetterBadAssert()
{
var t = new Test {
Member = "QuickTest.Tests.RunTests+Person.FullName",
ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
AssertString = "FullName == \"Frank Krueger\" && FirstName == \"Foo\"",
TestType = TestType.PropertyGetter,
};
t.Run ();
Assert.AreEqual (TestResult.Fail, t.Result, t.FailInfo);
Assert.AreEqual ("Assert Fail", t.FailInfo);
}
示例6: PropertySetterAssert
public void PropertySetterAssert()
{
var t = new Test {
Member = "QuickTest.Tests.RunTests+Person.FirstName",
ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
AssertString = "FullName == \"Alva Krueger\"",
TestType = TestType.PropertySetter,
};
t.Arguments.Add (new TestArgument { Name = "value", ValueString = "\"Alva\"", ValueType = "System.String" });
t.Run ();
Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
}
示例7: PropertyGetterUnknown
public void PropertyGetterUnknown()
{
var t = new Test {
Member = "QuickTest.Tests.RunTests+Person.FullName",
ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
TestType = TestType.PropertyGetter,
};
t.Run ();
Assert.AreEqual (TestResult.Unknown, t.Result, t.FailInfo);
}
示例8: PropertyGetterBadExpected
public void PropertyGetterBadExpected()
{
var t = new Test {
Member = "QuickTest.Tests.RunTests+Person.FullName",
ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
TestType = TestType.PropertyGetter,
ExpectedValueString = "Frank A. Krueger",
};
t.Run ();
Assert.AreEqual (TestResult.Fail, t.Result);
Assert.AreEqual ("Expected Value Fail", t.FailInfo);
}
示例9: Main
/// <summary>
/// Programmets startpunkt.
/// </summary>
static void Main()
{
bool exit = false;
NoiseObjectType type = NoiseObjectType.Indefinite;
do
{
switch (GetMenuChoice())
{
case 0:
exit = true;
continue;
case 1:
type = NoiseObjectType.Cat;
break;
case 2:
type = NoiseObjectType.Dog;
break;
case 3:
type = NoiseObjectType.Car;
break;
case 4:
Console.Clear();
Test test = new Test();
test.Run();
continue;
#if DEBUG
default:
Debug.Assert(false, "Hantering av menyalternativet saknas.");
continue;
#endif
}
Console.Clear();
INoise noise = CreateNoiseObject(type);
noise.MakeNoise();
ContinueOnKeyPressed();
} while (!exit);
}