Ejemplo n.º 1
0
        protected override async Task <(DomainObject[], object)> CreateObjectsAsync()
        {
            var result = new DomainObject[3];

            for (var i = 0; i < result.Length; i++)
            {
                var pubSub = new RedisPubSub(Options.Create(new RedisPubSubOptions
                {
                    Configuration = ConfigurationOptions.Parse("localhost")
                }), A.Fake <ILogger <RedisPubSub> >());

                await pubSub.EnsureConnectedAsync();

                result[i] = DomainObject.Create(pubSub);
            }

            await Task.Yield();

            return(result, null);
        }
Ejemplo n.º 2
0
        private static async Task <IList <IPubSub> > CreatePubSubsAsync()
        {
            var pubsub1 = new RedisPubSub(Options.Create(new RedisPubSubOptions
            {
                Configuration = ConfigurationOptions.Parse("localhost")
            }), A.Fake <ILogger <RedisPubSub> >());

            var pubsub2 = new RedisPubSub(Options.Create(new RedisPubSubOptions
            {
                Configuration = ConfigurationOptions.Parse("localhost")
            }), A.Fake <ILogger <RedisPubSub> >());

            await pubsub1.EnsureConnectedAsync();

            await pubsub2.EnsureConnectedAsync();

            return(new List <IPubSub> {
                pubsub1, pubsub2
            });
        }