public async Task Start()
 {
     ChannelNamespace   = EnvelopeId.NewId();
     ListenerUri        = new Uri("redis://localhost");
     EnvelopeSerializer = new EnvelopeSerializer(new DocumentTypeResolver().WithMessagingDocuments());
     TraceWriter        = new Mock <ITraceWriter>();
     Listener           = new RedisTransportListener(ListenerUri, EnvelopeSerializer, TraceWriter.Object, channelNamespace: ChannelNamespace);
     CancellationToken  = TimeSpan.FromSeconds(5).ToCancellationToken();
     _redisFixture      = new RedisFixture();
     await Listener.StartAsync(CancellationToken);
 }
        public RedisTransportTests(RedisFixture redisFixture)
        {
            _redisFixture = redisFixture;

            ChannelNamespace   = EnvelopeId.NewId();
            ListenerUri        = new Uri("redis://localhost");
            EnvelopeSerializer = new JsonNetSerializer();
            TraceWriter        = new Mock <ITraceWriter>();
            Listener           = new RedisTransportListener(ListenerUri, EnvelopeSerializer, TraceWriter.Object, channelNamespace: ChannelNamespace);
            CancellationToken  = TimeSpan.FromSeconds(5).ToCancellationToken();
            Listener.StartAsync(CancellationToken).Wait();
        }
示例#3
0
        public async Task SetUpAsync()
        {
            Registrator.RegisterDocuments();
            ChannelNamespace   = EnvelopeId.NewId();
            ListenerUri        = new Uri("redis://localhost");
            EnvelopeSerializer = new JsonNetSerializer();
            TraceWriter        = new Mock <ITraceWriter>();
            Listener           = new RedisTransportListener(ListenerUri, EnvelopeSerializer, TraceWriter.Object, channelNamespace: ChannelNamespace);
            await Listener.StartAsync(CancellationToken);

            CancellationToken = TimeSpan.FromSeconds(5).ToCancellationToken();
        }