Ejemplo n.º 1
0
        public void It_should_allow_to_apply_context_provider()
        {
            ExpectNewScenario();
            ExpectContext();

            Runner.Object.WithContext(() => TimeSpan.FromSeconds(5)).Integrate().NewScenario();

            VerifyAllExpectations();
            Assert.That(CapturedContextProvider.Invoke(), Is.EqualTo(TimeSpan.FromSeconds(5)));
        }
Ejemplo n.º 2
0
        public void It_should_allow_to_apply_context_with_parameterless_constructor()
        {
            ExpectNewScenario();
            ExpectContext();

            Runner.Object.WithContext <MyContext>().Integrate().NewScenario();

            VerifyAllExpectations();
            Assert.That(CapturedContextProvider.Invoke(), Is.InstanceOf <MyContext>());
        }
Ejemplo n.º 3
0
        public void It_should_allow_to_apply_context_instance()
        {
            ExpectNewScenario();
            ExpectContext();

            var context = new object();

            Runner.Object.WithContext(context).Integrate().NewScenario();

            VerifyAllExpectations();
            Assert.That(CapturedContextProvider.Invoke(), Is.SameAs(context));
        }