Ejemplo n.º 1
0
        public void Set_pending_specification_should_be_returned_scenario1()
        {
            var call = Substitute.For <ICall>();
            var specificationInfo = PendingSpecificationInfo.FromLastCall(call);

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

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

            Assert.That(encapsulatedObject, Is.SameAs(call));
        }
Ejemplo n.º 2
0
            public override void Context()
            {
                base.Context();

                _call = mock <ICall>();

                var specificationInfo = PendingSpecificationInfo.FromLastCall(_call);

                _pendingSpecification.stub(x => x.HasPendingCallSpecInfo()).Return(true);
                _pendingSpecification.stub(x => x.UseCallSpecInfo()).Return(specificationInfo);

                _callSpecification = mock <ICallSpecification>();
                _callSpecificationFactory.stub(x => x.CreateFrom(_call, _argMatchStrategy)).Return(_callSpecification);
            }
Ejemplo n.º 3
0
        public void Pending_specification_getter_should_not_remove_value()
        {
            var call = Substitute.For <ICall>();
            var specificationInfo = PendingSpecificationInfo.FromLastCall(call);

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

            result = SubstitutionContext.Current.PendingSpecificationInfo;
            result = SubstitutionContext.Current.PendingSpecificationInfo;

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

            Assert.That(encapsulatedObject, Is.SameAs(call));
        }
Ejemplo n.º 4
0
            public override void Context()
            {
                base.Context();

                _specInfo = PendingSpecificationInfo.FromLastCall(mock <ICall>());
            }