Beispiel #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);
        }
        protected override async Task <(DomainObject[], TestCluster)> CreateObjectsAsync()
        {
            var cluster =
                new TestClusterBuilder(3)
                .AddSiloBuilderConfigurator <Configurator>()
                .Build();

            await cluster.DeployAsync();

            var domainObjects =
                cluster.Silos.OfType <InProcessSiloHandle>()
                .Select(x =>
            {
                var pubSub = x.SiloHost.Services.GetRequiredService <IPubSub>();

                return(DomainObject.Create(pubSub));
            }).ToArray();

            return(domainObjects, cluster);
        }