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"); }
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)); }
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"); }
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(); }
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(); }
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"); }
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"); }
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); }
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"); }
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"); }