Example #1
0
            public override void Context()
            {
                base.Context();
                _lastCallSpecification = mock <ICallSpecification>();
                _pendingSpecification.stub(x => x.HasPendingCallSpecInfo()).Return(true);

                var specificationInfo = PendingSpecificationInfo.FromCallSpecification(_lastCallSpecification);

                _pendingSpecification.stub(x => x.UseCallSpecInfo()).Return(specificationInfo);
            }
Example #2
0
            public override void Context()
            {
                base.Context();
                _callSpecUpdatedForAnyArgs = mock <ICallSpecification>();
                _lastCallSpecification     = mock <ICallSpecification>();

                var specificationInfo = PendingSpecificationInfo.FromCallSpecification(_lastCallSpecification);

                _pendingSpecification.stub(x => x.HasPendingCallSpecInfo()).Return(true);
                _pendingSpecification.stub(x => x.UseCallSpecInfo()).Return(specificationInfo);
                _lastCallSpecification.stub(x => x.CreateCopyThatMatchesAnyArguments()).Return(_callSpecUpdatedForAnyArgs);
            }
Example #3
0
        public void Set_pending_specification_should_be_returned_scenario2()
        {
            var callSpec          = Substitute.For <ICallSpecification>();
            var specificationInfo = PendingSpecificationInfo.FromCallSpecification(callSpec);

            SubstitutionContext.Current.PendingSpecificationInfo = specificationInfo;
            var result = SubstitutionContext.Current.PendingSpecificationInfo;

            var encapsulatedObject = result.Handle <object>(x => x, x => x);

            Assert.That(encapsulatedObject, Is.SameAs(callSpec));
        }