// Use this to set up the test suite public void Start() { Session = new Session(); Session.AddAll(typeof(TestSample)); Suite = new UnityTestSuite(); TestsRunned = false; }
public static Session CreateSessionFor(Assembly assembly) { Session session = new Session(); foreach (Type testClass in GetTestClassesIn(assembly)) { session.AddAll(testClass); } return session; }
public static Session CreateSessionFor(IEnumerable<Assembly> assemblies) { Session session = new Session(); foreach (Assembly assembly in assemblies) { foreach (Type testClass in GetTestClassesIn(assembly)) { session.AddAll(testClass); } } return session; }
public void RunningSimpleTests() { Mock<AbstractTestReporter> reporterMock = new Mock<AbstractTestReporter>(); TestSuite suite = new TestSuiteMock(reporterMock.Object); Session session = new Session(); session.AddAll(typeof(TestClass)); session.Add(typeof(AnotherTestClass).GetMethod("Blub")); suite.RunSimpleTests(session); AssertThatTheMethodsAreCalledCorrectlyAfterRunningAllSimpleTests(); reporterMock.Verify(rep => rep.PresentReports(), Times.Once()); }
public void AddingTests() { Session session = new Session(); AssertEx.That(() => session.AddAll(typeof(NotAttributedMock)), Throws.An<ArgumentException>()); AssertEx.That(() => session.Add(typeof(NotAttributedMock).GetMethod("Foo")), Throws.An<ArgumentException>()); }