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"); }
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"); }
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()); }
public ISubscription EnhanceSubscription(ISubscription subscription) { return(_shaperAggregate.EnhanceSubscription(subscription)); }