Exemplo n.º 1
0
        public void ExecuteCorrectlyInvokeDoubleAction()
        {
            // Arrange
            var specimen = this.CreateSpecimen();
            var context  = new DelegatingSpecimenContext();

            var verified = false;
            Action <T, ISpecimenContext> mock =
                (s, c) => verified = specimen.Equals(s) && c == context;

            var sut = new ActionSpecimenCommand <T>(mock);

            // Act
            sut.Execute(specimen, context);
            // Assert
            Assert.True(verified, "Action not invoked with expected specimen.");
        }
        public void ExecuteCorrectlyInvokeDoubleAction()
        {
            // Fixture setup
            var specimen = this.CreateSpecimen();
            var context  = new DelegatingSpecimenContext();

            var verified = false;
            Action <T, ISpecimenContext> mock =
                (s, c) => verified = specimen.Equals(s) && c == context;

            var sut = new ActionSpecimenCommand <T>(mock);

            // Exercise system
            sut.Execute(specimen, context);
            // Verify outcome
            Assert.True(verified, "Action not invoked with expected specimen.");
            // Teardown
        }