public void AddHttpRemoteStoreAndHttpRemoteStoreClient()
        {
            var services = new ServiceCollection();
            var builder  = new FinbuckleMultiTenantBuilder <TenantInfo>(services);

            builder.WithHttpRemoteStore("http://example.com");
            var sp = services.BuildServiceProvider();

            sp.GetRequiredService <HttpRemoteStoreClient <TenantInfo> >();
            var store = sp.GetRequiredService <IMultiTenantStore <TenantInfo> >();

            Assert.IsType <HttpRemoteStore <TenantInfo> >(store);
        }
Example #2
0
    public void AddHttpRemoteStoreWithHttpClientBuilders()
    {
        var services = new ServiceCollection();
        var builder  = new FinbuckleMultiTenantBuilder(services);
        var flag     = false;

        builder.WithHttpRemoteStore("http://example.com", b => flag = true);
        var sp = services.BuildServiceProvider();

        sp.GetRequiredService <HttpRemoteStoreClient>();
        var store = sp.GetRequiredService <IMultiTenantStore>();

        Assert.IsType <MultiTenantStoreWrapper <HttpRemoteStore> >(store);
        Assert.True(flag);
    }