Executable context implementation which is also responsible for creating behavior contexts. The IDescribable is released right after creation.
Inheritance: IExecutableContext
Esempio n. 1
0
        public void CreateBehaviorContext_ShouldCreateBehaviorContext()
        {
            ExecutableContext testee = CreateTestee(Mock.Of <IDescribable>());

            var behaviorContext = testee.CreateBehaviorContext(Mock.Of <IDescribable>());

            testee.Behaviors.Should().NotBeEmpty()
            .And.HaveCount(1)
            .And.Contain(behaviorContext);
        }
Esempio n. 2
0
        public void Constructor_ShouldDescribe()
        {
            const string ExpectedName        = "Name";
            const string ExpectedDescription = "TestDescription";

            this.describable.Setup(d => d.Name).Returns(ExpectedName);
            this.describable.Setup(d => d.Describe()).Returns(ExpectedDescription);

            ExecutableContext testee = CreateTestee(this.describable.Object);

            testee.Name.Should().Be(ExpectedName);
            testee.Description.Should().Be(ExpectedDescription);
            this.describable.Verify(d => d.Describe());
        }
Esempio n. 3
0
        public void Constructor_ShouldDescribe()
        {
            const string ExpectedName        = "Name";
            const string ExpectedDescription = "TestDescription";

            A.CallTo(() => this.describable.Name).Returns(ExpectedName);
            A.CallTo(() => this.describable.Describe()).Returns(ExpectedDescription);

            ExecutableContext testee = CreateTestee(this.describable);

            testee.Name.Should().Be(ExpectedName);
            testee.Description.Should().Be(ExpectedDescription);
            A.CallTo(() => this.describable.Describe()).MustHaveHappened();
        }
Esempio n. 4
0
        public void Constructor_Behaviors_ShouldBeEmpty()
        {
            ExecutableContext testee = CreateTestee(Mock.Of <IDescribable>());

            testee.Behaviors.Should().BeEmpty();
        }