Exemplo n.º 1
0
    public async Task Should_Get_FeatureValues_With_Provider_For_A_Provider()
    {
        var featureNameValueWithGrantedProviders = await _featureManager.GetAllWithProviderAsync(
            EditionFeatureValueProvider.ProviderName,
            TestEditionIds.Enterprise.ToString()
            );

        featureNameValueWithGrantedProviders.ShouldContain(x =>
                                                           x.Name == TestFeatureDefinitionProvider.SocialLogins &&
                                                           x.Value == true.ToString().ToLowerInvariant() &&
                                                           x.Provider.Name == EditionFeatureValueProvider.ProviderName);

        featureNameValueWithGrantedProviders.ShouldContain(x =>
                                                           x.Name == TestFeatureDefinitionProvider.EmailSupport &&
                                                           x.Value == true.ToString().ToLowerInvariant() &&
                                                           x.Provider.Name == EditionFeatureValueProvider.ProviderName);

        //Default Value
        featureNameValueWithGrantedProviders.ShouldContain(x =>
                                                           x.Name == TestFeatureDefinitionProvider.DailyAnalysis &&
                                                           x.Value == false.ToString().ToLowerInvariant() &&
                                                           x.Provider.Name == DefaultValueFeatureValueProvider.ProviderName);

        featureNameValueWithGrantedProviders.ShouldContain(x =>
                                                           x.Name == TestFeatureDefinitionProvider.UserCount &&
                                                           x.Value == "20" &&
                                                           x.Provider.Name == EditionFeatureValueProvider.ProviderName);

        featureNameValueWithGrantedProviders.ShouldContain(x =>
                                                           x.Name == TestFeatureDefinitionProvider.ProjectCount &&
                                                           x.Value == "3" &&
                                                           x.Provider.Name == EditionFeatureValueProvider.ProviderName);

        featureNameValueWithGrantedProviders.ShouldContain(x =>
                                                           x.Name == TestFeatureDefinitionProvider.BackupCount &&
                                                           x.Value == "5" &&
                                                           x.Provider.Name == EditionFeatureValueProvider.ProviderName);
    }
 public static Task <List <FeatureNameValueWithGrantedProvider> > GetAllWithProviderAsync(this IFeatureManager featureManager, bool fallback = true)
 {
     return(featureManager.GetAllWithProviderAsync(DefaultValueFeatureValueProvider.ProviderName, null, fallback));
 }
 public static Task <List <FeatureNameValueWithGrantedProvider> > GetAllWithProviderForEditionAsync(this IFeatureManager featureManager, Guid editionId, bool fallback = true)
 {
     return(featureManager.GetAllWithProviderAsync(EditionFeatureValueProvider.ProviderName, editionId.ToString(), fallback));
 }
Exemplo n.º 4
0
 public static Task <List <FeatureNameValueWithGrantedProvider> > GetAllWithProviderForClientAsync(this IFeatureManager featureManager, string clientId, bool fallback = true)
 {
     return(featureManager.GetAllWithProviderAsync(ClientFeatureValueProvider.ProviderName, clientId, fallback));
 }