Пример #1
0
        public void WhenExecuted_ShouldYield_DefaultSubstitutableClockFlow()
        {
            var passedFlow = default(IClockFlow);

            TestComposer
            .Prepare(flow => passedFlow = flow)
            .Execute();

            Assert.NotNull(passedFlow);
            Assert.Same(passedFlow, SubstitutableClockFlow.Default);
        }
Пример #2
0
        public void WhenExecuted_ShouldCall_PrepareFactory()
        {
            const string methodName = nameof(TestComposer.IExecutable <object> .Execute);

            var called = false;

            object SampleFactory(IClockFlow _)
            {
                called = true;
                return(new object());
            }

            var preparedExecutable = TestComposer
                                     .Prepare(SampleFactory);

            Assert.False(called, $"Expecting to not call given Factory before '{methodName}'.");

            preparedExecutable
            .Execute();

            Assert.True(called, $"Expecting to call given Factory after '{methodName}'.");
        }