public void GivenTypeWithNUnitTestsWhenBDDTestSuiteIsConstructed() { _constructedFixture = new object(); _fixtureType = typeof(BDDTestFixtureTestClass); _mockReflectionProvider = new Mock<IReflectionProvider>(); _mockReflectionProvider.Setup(rp => rp.Construct(It.IsAny<Type>())).Returns(_constructedFixture); _methods = new[] { new NUnitTestMethod(typeof (BDDTestFixtureTestClass).GetMethod("TestMethod1")), new NUnitTestMethod(typeof (BDDTestFixtureTestClass).GetMethod("TestMethod2")) }; _mockTypeManager = new Mock<ITypeManager>(); _mockTypeManager.Setup(tm => tm.GetNUnitTestMethodsWithAttribute(It.IsAny<Type>(), It.IsAny<Type>())). Returns(_methods); _bddTestSuite = new BDDTestSuite(_mockReflectionProvider.Object, _mockTypeManager.Object, _fixtureType); }
public void GivenWhenDoOneTimeSetUp() { _givenMethods = new[] { new NUnitTestMethod(typeof (BDDTestFixtureTestClass).GetMethod("GivenMethod1")) }; _whenMethods = new[] { new NUnitTestMethod(typeof (BDDTestFixtureTestClass).GetMethod("WhenMethod1")) }; _mockTypeManager = new Mock<ITypeManager>(); _mockTypeManager .Setup(tm => tm.GetNUnitTestMethodsWithAttribute(It.IsAny<Type>(), typeof(GivenAttribute))) .Returns(_givenMethods); _mockTypeManager .Setup(tm => tm.GetNUnitTestMethodsWithAttribute(It.IsAny<Type>(), typeof(WhenAttribute))) .Returns(_whenMethods); _fixtureType = typeof (BDDTestFixtureTestClass); _mockReflectionProvider = new Mock<IReflectionProvider>(); var bddTestSuite = new BDDTestSuite(_mockReflectionProvider.Object, _mockTypeManager.Object, _fixtureType); _fixture = new object(); bddTestSuite.Fixture = _fixture; bddTestSuite.RunExecuteActions(); }