public ManualPublisher(TestEnvironment environment) { Environment = environment; Requests = new Receptacle <long>(environment); Cancelled = new Latch(environment); Subscriber = new Promise <ISubscriber <T> >(environment); }
public Spec205Subscription(TestEnvironment environment, Latch secondSubscriptionCancelled, ISubscriber <T> subscriber) { _environment = environment; _secondSubscriptionCancelled = secondSubscriptionCancelled; _subscriber = subscriber; }
Required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal () { var stage = new BlackBoxTestStage <T>(Environment, this); // try to subscribe another time, if the subscriber calls `probe.RegisterOnSubscribe` the test will fail var secondSubscriptionCancelled = new Latch(Environment); stage.Sub.OnSubscribe(new Spec205Subscription(Environment, secondSubscriptionCancelled, stage.Sub)); secondSubscriptionCancelled.ExpectClose( "Expected SecondSubscription given to subscriber to be cancelled, but `Subscription.cancel()` was not called."); Environment.VerifyNoAsyncErrorsNoDelay(); }
public void Required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() => SubscriberTest(stage => { // try to subscribe another time, if the subscriber calls `probe.RegisterOnSubscribe` the test will fail var secondSubscriptionCancelled = new Latch(_environment); var subscriber = stage.Sub; var subscription = new Spec205Subscription(secondSubscriptionCancelled); subscriber.OnSubscribe(subscription); secondSubscriptionCancelled.ExpectClose( "Expected 2nd Subscription given to subscriber to be cancelled, but `Subscription.cancel()` was not called"); _environment.VerifyNoAsyncErrors(); });
public Receptacle(TestEnvironment environment) { _environment = environment; _completedLatch = new Latch(environment); }
public Spec205Subscription(Latch secondSubscriptionCancelled) { _secondSubscriptionCancelled = secondSubscriptionCancelled; }