internal static async Task StartClient()
        {
            var client = ClientBuilderExtensions.ConfigureServices(new ClientBuilder()
                                                                   .AddOutgoingGrainCallFilter <OutgoingGrainCallAuthorizationFilter>()
                                                                   .Configure <ClusterOptions>(options =>
            {
                options.ClusterId = TestClusterOptions.ClusterId;
                options.ServiceId = TestClusterOptions.ServiceId;
            }), services =>
            {
                services.AddOrleansClusterAuthorization(AuthorizationTestConfig.ConfigureOptions,
                                                        AuthorizationTestConfig.ConfigureServices);

                services.AddSingleton <IAccessTokenProvider, FakeAccessTokenProvider>();
                services.AddSingleton(new OAuth2EndpointInfo("authorityUrl", "clientScopeName", "clientSecret"));
            })
                         .UseLocalhostClustering()
                         .Build();

            await client.Connect();

            Client = client;
        }
        public void AddActivityOutgoingFilter_ClientBuilderIsNull_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws <ArgumentNullException>(() => ClientBuilderExtensions.AddActivityOutgoingFilter(null));

            Assert.Equal("builder", exception.ParamName);
        }
示例#3
0
 public BlobTestBase(bool async, BlobClientOptions.ServiceVersion serviceVersion, RecordedTestMode?mode = null)
     : base(async, mode)
 {
     _serviceVersion    = serviceVersion;
     BlobsClientBuilder = ClientBuilderExtensions.GetNewBlobsClientBuilder(Tenants, _serviceVersion);
 }