public void SingleMessageConsumeAsync_() { var logger = new Mock <ILogger <TypedConsumerService <string> > >(); var queue = new Mock <IBackgroundTaskQueue <MotorCloudEvent <string> > >(); var deserializer = new Mock <IMessageDeserializer <string> >(); var consumer = new Mock <IMessageConsumer <string> >(); var consumerService = new TypedConsumerService <string>(logger.Object, queue.Object, deserializer.Object, consumer.Object); }
private static void CreateConsumerService(IBackgroundTaskQueue <MotorCloudEvent <string> >?queue = null, IMessageDeserializer <string>?deserializer = null, IEnumerable <IMessageDecoder>?decoders = null, IMessageConsumer <string>?consumer = null, bool ignoreEncoding = false) { queue ??= Mock.Of <IBackgroundTaskQueue <MotorCloudEvent <string> > >(); deserializer ??= Mock.Of <IMessageDeserializer <string> >(); decoders ??= new List <IMessageDecoder> { Mock.Of <IMessageDecoder>() }; consumer ??= Mock.Of <IMessageConsumer <string> >(); var encodingOptions = new ContentEncodingOptions { IgnoreEncoding = ignoreEncoding }; var _ = new TypedConsumerService <string>(Mock.Of <ILogger <TypedConsumerService <string> > >(), null, queue, deserializer, Options.Create(encodingOptions), decoders, consumer); }