Ejemplo n.º 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");
 }
Ejemplo n.º 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");
 }
Ejemplo n.º 3
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");
        }
Ejemplo n.º 4
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");
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 6
0
 public ISubscription EnhanceSubscription(ISubscription subscription)
 {
     return(_shaperAggregate.EnhanceSubscription(subscription));
 }