예제 #1
0
        public void scenario_title_should_be_number_and_class_name_if_number_greater_than_zero()
        {
            var container = new ContainerFor <ConcreteObjectWithNoConstructor>(Substitute.For <IContainer>());
            var sut       = new UserStoryScenarioWithAllSupportedStepsInRandomOrder {
                Container = container, Number = 3
            };

            sut.Title.ShouldBe("Scenario 03: User Story Scenario With All Supported Steps In Random Order");
        }
예제 #2
0
        public void should_resolve_specification_from_child_container()
        {
            var spec = new UserStoryScenarioWithAllSupportedStepsInRandomOrder();
            var sut  = CreateSut(spec);

            sut.Execute(spec);

            sut.ChildContainer.Received(1).Resolve(typeof(UserStoryScenarioWithAllSupportedStepsInRandomOrder));
        }
예제 #3
0
        public void scenario_title_should_be_class_name_only_if_scenario_is_zero()
        {
            var container = new ContainerFor <ConcreteObjectWithNoConstructor>(Substitute.For <IContainer>());
            var sut       = new UserStoryScenarioWithAllSupportedStepsInRandomOrder {
                Container = container
            };

            sut.Title.ShouldBe("User Story Scenario With All Supported Steps In Random Order");
        }
예제 #4
0
        public void should_resolve_specification_from_child_container()
        {
            var spec = new UserStoryScenarioWithAllSupportedStepsInRandomOrder();
            var sut = CreateSut(spec);

            sut.Execute(spec);

            sut.ChildContainer.Received(1).Resolve(typeof(UserStoryScenarioWithAllSupportedStepsInRandomOrder));
        }
예제 #5
0
        public void should_create_and_dispose_child_container_per_test()
        {
            var spec = new UserStoryScenarioWithAllSupportedStepsInRandomOrder();
            var sut  = CreateSut(spec);

            sut.Execute(spec);

            sut.DependencyResolver.Received(1).CreateChildContainer();
            sut.ChildContainer.Received(1).Dispose();
        }
예제 #6
0
        public void should_create_and_dispose_child_container_per_test()
        {
            var spec = new UserStoryScenarioWithAllSupportedStepsInRandomOrder();
            var sut = CreateSut(spec);

            sut.Execute(spec);

            sut.ApplicationContainer.Received(1).CreateChildContainer();
            sut.ChildContainer.Received(1).Dispose();
        }
예제 #7
0
        public void should_call_per_test_actions_after_test()
        {
            var spec = new UserStoryScenarioWithAllSupportedStepsInRandomOrder();
            var sut  = CreateSut(spec);

            sut.Execute(spec);

            StubAction.AfterActions.Count.ShouldBe(2);
            StubAction.AfterActions[0].ShouldBe("PerTestAction 2");
            StubAction.AfterActions[1].ShouldBe("PerTestAction 1");
        }
예제 #8
0
        public void should_call_per_test_actions_before_test()
        {
            var spec = new UserStoryScenarioWithAllSupportedStepsInRandomOrder();
            var sut = CreateSut(spec);

            sut.Execute(spec);

            StubPerScenarioAction.BeforeActions.Count.ShouldBe(2);
            StubPerScenarioAction.BeforeActions[0].ShouldBe("PerTestAction 1");
            StubPerScenarioAction.BeforeActions[1].ShouldBe("PerTestAction 2");
        }
예제 #9
0
        public override void SetUp()
        {
            base.SetUp();

            Container.Set <IConfigureSpecify>(new StubConfig());

            _spec           = new UserStoryScenarioWithAllSupportedStepsInRandomOrder();
            _childContainer = Substitute.For <IContainer>();
            _childContainer.Resolve(Arg.Any <Type>()).Returns(_spec);

            SUT.Configuration.ApplicationContainer.Resolve <IContainer>().Returns(_childContainer);
        }
예제 #10
0
 public void scenario_title_should_be_number_and_class_name_if_number_greater_than_zero()
 {
     var container = new SutFactory<ConcreteObjectWithNoConstructor>(Substitute.For<IScenarioContainer>());
     var sut = new UserStoryScenarioWithAllSupportedStepsInRandomOrder {Container = container, Number = 3};
     sut.Title.ShouldBe("Scenario 03: User Story Scenario With All Supported Steps In Random Order");
 }
예제 #11
0
 public void scenario_title_should_be_class_name_only_if_scenario_is_zero()
 {
     var container = new SutFactory<ConcreteObjectWithNoConstructor>(Substitute.For<IScenarioContainer>());
     var sut = new UserStoryScenarioWithAllSupportedStepsInRandomOrder {Container = container};
     sut.Title.ShouldBe("User Story Scenario With All Supported Steps In Random Order");
 }