public static void HasTestSuitesProperty(TestRunner r) { harness.FindTests(); string foundName = harness.TestSuites[sampleSuiteName].Name; r.Expect(foundName).ToBe(sampleSuiteName); }
public static void GetTestsReturnsAllTestsInSampleSuite(TestRunner r) { harness.FindTests(); List<TestRunner> testsFound = harness.GetTestsInSuite(sampleSuiteName); r.Expect(testsFound.Count).ToBe(2); }
public static void MethodHasAttributeReturnsTrueWhenMethodHasAttribute(TestRunner r) { MethodInfo method = _GetMethod("HasName"); bool testAttrCheck = TestSuite.MethodHasAttribute<TestAttribute>(method); r.Expect(testAttrCheck).ToBe(true); }
public static void FindsAllMethodsInSampleSuite(TestRunner r) { harness.FindTests(); Type sampleType = typeof(SampleTestsSpec); List<MethodInfo> methods = TestHarness.FindTestMethodsInType(sampleType); r.Expect(methods.Count).ToBe(3); }
public static void MethodHasAttributeReturnsFalseWhenMethodDoesNotHaveAttribute(TestRunner r) { MethodInfo method = _GetMethod("HasName"); bool testAttrCheck = TestSuite.MethodHasAttribute<HasTestsAttribute>(method); r.Expect(testAttrCheck).ToBe(false); }
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); }
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); }
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); }
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); }
public static void ExpectHelloNotToBeHi(TestRunner tr) { tr.Expect("Hello").Not.ToBe("Hi"); }
public static void ExpectTwoToBeGreaterThanOne(TestRunner tr) { tr.Expect(2).ToBeGreaterThan(1); }
public static void ExpectTwoNotToBeLessThanTwo(TestRunner tr) { tr.Expect(2).Not.ToBeLessThan(2); }
public static void ThisIsASampleTest(TestRunner r) { r.Expect(true).ToBe(false); }
public static void ExpectOneToBeLessThanTwo(TestRunner tr) { tr.Expect(1).ToBeLessThan(2); }
public static void ExpectOnePointOneFloatNotToBeOneInteger(TestRunner tr) { tr.Expect(1.1f).Not.ToBe(1); }
public static void ExpectOneNotToBeTwo(TestRunner tr) { tr.Expect(1).Not.ToBe(2); }
public static void ExpectOneFloatToBeOneInteger(TestRunner tr) { tr.Expect(1f).ToBe(1); }
public static void ExpectHelloToBeHello(TestRunner tr) { tr.Expect("Hello").ToBe("Hello"); }
public static void ExpectTrueNotToBeNotTrue(TestRunner tr) { tr.Expect(true).Not.Not.ToBe(true); }
public static void HasName(TestRunner r) { r.Expect(testSuite.Name).ToBe("My Awesome Test Suite"); }
public static void ExpectTrueToBeTrue(TestRunner tr) { tr.Expect(true).ToBe(true); }
public static void ExpectOneToBeOne(TestRunner tr) { tr.Expect(1).ToBe(1); }
public static void ExpectMemeberNotToBeFalse(TestRunner r) { r.Expect(_member).Not.ToBe(false); }