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


C# TestRunner.Expect方法代码示例

本文整理汇总了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);
    }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例2: GetTestsReturnsAllTestsInSampleSuite

    public static void GetTestsReturnsAllTestsInSampleSuite(TestRunner r)
    {
        harness.FindTests();

        List<TestRunner> testsFound = harness.GetTestsInSuite(sampleSuiteName);

        r.Expect(testsFound.Count).ToBe(2);
    }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例3: MethodHasAttributeReturnsTrueWhenMethodHasAttribute

    public static void MethodHasAttributeReturnsTrueWhenMethodHasAttribute(TestRunner r)
    {
        MethodInfo method = _GetMethod("HasName");

        bool testAttrCheck = TestSuite.MethodHasAttribute<TestAttribute>(method);

        r.Expect(testAttrCheck).ToBe(true);
    }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例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);
    }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例5: MethodHasAttributeReturnsFalseWhenMethodDoesNotHaveAttribute

    public static void MethodHasAttributeReturnsFalseWhenMethodDoesNotHaveAttribute(TestRunner r)
    {
        MethodInfo method = _GetMethod("HasName");

        bool testAttrCheck = TestSuite.MethodHasAttribute<HasTestsAttribute>(method);

        r.Expect(testAttrCheck).ToBe(false);
    }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例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);
    }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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);
    }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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);
    }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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);
    }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例10: ExpectHelloNotToBeHi

 public static void ExpectHelloNotToBeHi(TestRunner tr)
 {
     tr.Expect("Hello").Not.ToBe("Hi");
 }
开发者ID:,项目名称:,代码行数:4,代码来源:

示例11: ExpectTwoToBeGreaterThanOne

 public static void ExpectTwoToBeGreaterThanOne(TestRunner tr)
 {
     tr.Expect(2).ToBeGreaterThan(1);
 }
开发者ID:,项目名称:,代码行数:4,代码来源:

示例12: ExpectTwoNotToBeLessThanTwo

 public static void ExpectTwoNotToBeLessThanTwo(TestRunner tr)
 {
     tr.Expect(2).Not.ToBeLessThan(2);
 }
开发者ID:,项目名称:,代码行数:4,代码来源:

示例13: ThisIsASampleTest

 public static void ThisIsASampleTest(TestRunner r)
 {
     r.Expect(true).ToBe(false);
 }
开发者ID:,项目名称:,代码行数:4,代码来源:

示例14: ExpectOneToBeLessThanTwo

 public static void ExpectOneToBeLessThanTwo(TestRunner tr)
 {
     tr.Expect(1).ToBeLessThan(2);
 }
开发者ID:,项目名称:,代码行数:4,代码来源:

示例15: ExpectOnePointOneFloatNotToBeOneInteger

 public static void ExpectOnePointOneFloatNotToBeOneInteger(TestRunner tr)
 {
     tr.Expect(1.1f).Not.ToBe(1);
 }
开发者ID:,项目名称:,代码行数:4,代码来源:


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