public void cant_get_non_existent_subscription() { var channel = Substitute.For <ITcpChannel>(); var transactionManager = Substitute.For <ITransactionManager>(); var sut = new StompClient(channel, transactionManager); Action actual = () => sut.GetSubscription("abc"); actual.ShouldThrow <NotFoundException>(); }
public void get_existent_subscription() { var channel = Substitute.For <ITcpChannel>(); var transactionManager = Substitute.For <ITransactionManager>(); var client = Substitute.For <IStompClient>(); var subscription = new Subscription(client, "abc"); var frame = new BasicFrame("SEND"); frame.AddHeader("message-id", "kdkd"); subscription.AckType = "client-individual"; subscription.Send(frame); var sut = new StompClient(channel, transactionManager); sut.AddSubscription(subscription); var actual = sut.GetSubscription("kdkd"); actual.Should().BeSameAs(subscription); }