public void AddConsumerWithNullTest() { var testing = new EchoControllerActor(); testing.AddConsumer(null); testing.ConsumerCount.Should().Be(0); }
public void RemoveConsumerNegativeTest() { var testing = new EchoControllerActor(); Mock <IConsumer> consumer1 = new Mock <IConsumer>(); consumer1.Setup(x => x.Id).Returns(Id1); Mock <IConsumer> consumer2 = new Mock <IConsumer>(); consumer2.Setup(x => x.Id).Returns(Id2); Mock <IStreamSubscriber> subscriber1 = new Mock <IStreamSubscriber>(); subscriber1.Setup(x => x.Consumer).Returns(consumer1.Object); Mock <IStreamSubscriber> subscriber2 = new Mock <IStreamSubscriber>(); subscriber2.Setup(x => x.Consumer).Returns(consumer2.Object); testing.AddConsumer(subscriber1.Object); testing.ConsumerCount.Should().Be(1); testing.RemoveConsumer(subscriber2.Object); testing.ConsumerCount.Should().Be(1); }
private void AddConsumer(EchoControllerActor actor, string consumerId) { Mock <IConsumer> consumer = new Mock <IConsumer>(); consumer.Setup(x => x.Id).Returns(consumerId); Mock <IStreamSubscriber> subscriber = new Mock <IStreamSubscriber>(); subscriber.Setup(x => x.Consumer).Returns(consumer.Object); actor.AddConsumer(subscriber.Object); }
public void Add1ConsumerTest() { var testing = new EchoControllerActor(); Mock <IConsumer> consumer = new Mock <IConsumer>(); consumer.Setup(x => x.Id).Returns(Id1); Mock <IStreamSubscriber> subscriber = new Mock <IStreamSubscriber>(); subscriber.Setup(x => x.Consumer).Returns(consumer.Object); testing.AddConsumer(subscriber.Object); testing.ConsumerCount.Should().Be(1); }
private EchoControllerActor GetEchoControllerActorWith1Consumer(string consumerId) { var testing = new EchoControllerActor(); Mock <IConsumer> consumer = new Mock <IConsumer>(); consumer.Setup(x => x.Id).Returns(consumerId); Mock <IStreamSubscriber> subscriber = new Mock <IStreamSubscriber>(); subscriber.Setup(x => x.Consumer).Returns(consumer.Object); testing.AddConsumer(subscriber.Object); return(testing); }
public void GetDefaultEchosCountDownTest() { var testing = new EchoControllerActor(); Mock <IConsumer> consumer = new Mock <IConsumer>(); consumer.Setup(x => x.Id).Returns(Id1); Mock <IStreamSubscriber> subscriber = new Mock <IStreamSubscriber>(); subscriber.Setup(x => x.Consumer).Returns(consumer.Object); testing.AddConsumer(subscriber.Object); testing.GetEchosCountDown(Id1).Should().Be(UDAPI.Configuration.MissedEchos); }