本文整理汇总了C#中TestRunner.Expect方法的典型用法代码示例。如果您正苦于以下问题:C# TestRunner.Expect方法的具体用法?C# TestRunner.Expect怎么用?C# TestRunner.Expect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestRunner
的用法示例。
在下文中一共展示了TestRunner.Expect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasTestSuitesProperty
public static void HasTestSuitesProperty(TestRunner r)
{
harness.FindTests();
string foundName = harness.TestSuites[sampleSuiteName].Name;
r.Expect(foundName).ToBe(sampleSuiteName);
}
示例2: GetTestsReturnsAllTestsInSampleSuite
public static void GetTestsReturnsAllTestsInSampleSuite(TestRunner r)
{
harness.FindTests();
List<TestRunner> testsFound = harness.GetTestsInSuite(sampleSuiteName);
r.Expect(testsFound.Count).ToBe(2);
}
示例3: MethodHasAttributeReturnsTrueWhenMethodHasAttribute
public static void MethodHasAttributeReturnsTrueWhenMethodHasAttribute(TestRunner r)
{
MethodInfo method = _GetMethod("HasName");
bool testAttrCheck = TestSuite.MethodHasAttribute<TestAttribute>(method);
r.Expect(testAttrCheck).ToBe(true);
}
示例4: FindsAllMethodsInSampleSuite
public static void FindsAllMethodsInSampleSuite(TestRunner r)
{
harness.FindTests();
Type sampleType = typeof(SampleTestsSpec);
List<MethodInfo> methods = TestHarness.FindTestMethodsInType(sampleType);
r.Expect(methods.Count).ToBe(3);
}
示例5: MethodHasAttributeReturnsFalseWhenMethodDoesNotHaveAttribute
public static void MethodHasAttributeReturnsFalseWhenMethodDoesNotHaveAttribute(TestRunner r)
{
MethodInfo method = _GetMethod("HasName");
bool testAttrCheck = TestSuite.MethodHasAttribute<HasTestsAttribute>(method);
r.Expect(testAttrCheck).ToBe(false);
}
示例6: CanAddTestMethods
public static void CanAddTestMethods(TestRunner r)
{
string expected = "HasName";
MethodInfo method = _GetMethod(expected);
testSuite.AddMethod(method);
string methodName = testSuite.GetTestRunner(expected).MethodName;
r.Expect(testSuite.GetTestRunner(methodName).MethodName).ToBe(expected);
}
示例7: CanAddBeforeEachMethods
public static void CanAddBeforeEachMethods(TestRunner r)
{
string expected = "TestSuiteBeforeEach";
MethodInfo method = _GetMethod(expected);
testSuite.AddMethod(method);
string methodName = testSuite.GetBeforeEachTestRunner(expected).MethodName;
r.Expect(methodName).ToBe(expected);
}
示例8: GetTestRunnersReturnsAllRunnersForSampleSuite
public static void GetTestRunnersReturnsAllRunnersForSampleSuite(TestRunner r)
{
TestHarness harness = new TestHarness();
string sampleSuiteName = "TestFramework::SampleTests";
harness.FindTests();
TestSuite sampleSuite = harness.TestSuites[sampleSuiteName];
r.Expect(sampleSuite.GetTestRunners().Count).ToBe(2);
}
示例9: FindsTheSampleTestSuite
public static void FindsTheSampleTestSuite(TestRunner r)
{
harness.FindTests();
bool found = false;
foreach(string suitename in harness.GetSuiteNames())
{
if (suitename == sampleSuiteName) {
found = true;
}
}
r.Expect(found).ToBe(true);
}
示例10: ExpectHelloNotToBeHi
public static void ExpectHelloNotToBeHi(TestRunner tr)
{
tr.Expect("Hello").Not.ToBe("Hi");
}
示例11: ExpectTwoToBeGreaterThanOne
public static void ExpectTwoToBeGreaterThanOne(TestRunner tr)
{
tr.Expect(2).ToBeGreaterThan(1);
}
示例12: ExpectTwoNotToBeLessThanTwo
public static void ExpectTwoNotToBeLessThanTwo(TestRunner tr)
{
tr.Expect(2).Not.ToBeLessThan(2);
}
示例13: ThisIsASampleTest
public static void ThisIsASampleTest(TestRunner r)
{
r.Expect(true).ToBe(false);
}
示例14: ExpectOneToBeLessThanTwo
public static void ExpectOneToBeLessThanTwo(TestRunner tr)
{
tr.Expect(1).ToBeLessThan(2);
}
示例15: ExpectOnePointOneFloatNotToBeOneInteger
public static void ExpectOnePointOneFloatNotToBeOneInteger(TestRunner tr)
{
tr.Expect(1.1f).Not.ToBe(1);
}