示例#1
0
 public void Correct_sequence_of_matroschka()
 {
     var m = new SubscriptionShaperAggregate {new TestShaper("A"), new TestShaper("B")};
     var s = (NamedSubscription)m.EnhanceSubscription(new NamedSubscription("First", null));
     s.Name.ShouldBeEqualTo("B");
     ((NamedSubscription)s.Inner).Name.ShouldBeEqualTo("A");
 }
示例#2
0
 public void Next_to_inner_produces_correct_sequence()
 {
     var m = new SubscriptionShaperAggregate { new TestShaper("A") };
     m.AddNextToInner(new TestShaper("B"));
     var s = (NamedSubscription)m.EnhanceSubscription(new NamedSubscription("First", null));
     s.Name.ShouldBeEqualTo("A");
     ((NamedSubscription)s.Inner).Name.ShouldBeEqualTo("B");
 }
        public void Correct_sequence_of_matroschka()
        {
            var m = new SubscriptionShaperAggregate {
                new TestShaper("A"), new TestShaper("B")
            };
            var s = (NamedSubscription)m.EnhanceSubscription(new NamedSubscription("First", null));

            s.Name.ShouldBeEqualTo("B");
            ((NamedSubscription)s.Inner).Name.ShouldBeEqualTo("A");
        }
        public void Next_to_inner_produces_correct_sequence()
        {
            var m = new SubscriptionShaperAggregate {
                new TestShaper("A")
            };

            m.AddNextToInner(new TestShaper("B"));
            var s = (NamedSubscription)m.EnhanceSubscription(new NamedSubscription("First", null));

            s.Name.ShouldBeEqualTo("A");
            ((NamedSubscription)s.Inner).Name.ShouldBeEqualTo("B");
        }
示例#5
0
        public IDisposable Subscribe <M>(Action <M> subscription, ISubscriptionShaper customization)
        {
            CheckDisposed();
            var sShapeAgg = new SubscriptionShaperAggregate()
            {
                customization
            };

            sShapeAgg.Add(new ShapeToDispose());
            var sub = sShapeAgg.EnhanceSubscription(new MethodInvocation <M>(subscription));

            _resolvers.Add(sub);
            return(sub.TryReturnDisposerOfSubscription());
        }
示例#6
0
 public ISubscription EnhanceSubscription(ISubscription subscription)
 {
     return(_shaperAggregate.EnhanceSubscription(subscription));
 }