示例#1
0
        public async Task return_null_if_use_fullname_type_value()
        {
            var store = new FeatureStoreBuilder()
                        .WithFeatureConfigurer(new FeatureConfigurer(featureName)
                                               .WithActivator <UserActivator>(@params =>
            {
                @params.Add("USER", "uzorrilla");
            })).Build();

            (await store.FindParameterAsync("USER", featureName, typeof(UserActivator).FullName))
            .Should().BeNull();
        }
示例#2
0
        public async Task return_null_parameter_if_not_exist()
        {
            var store = new FeatureStoreBuilder()
                        .WithFeatureConfigurer(new FeatureConfigurer(featureName)
                                               .WithActivator <UserActivator>(@params =>
            {
                @params.Add("USER", "uzorrilla");
            })).Build();

            (await store.FindParameterAsync("non_existing_parameter", featureName, typeof(UserActivator).Name))
            .Should().BeNull();
        }
示例#3
0
        public async Task find_parameter_if_exist()
        {
            var store = new FeatureStoreBuilder()
                        .WithFeatureConfigurer(new FeatureConfigurer(featureName)
                                               .WithActivator <UserActivator>(@params =>
            {
                @params.Add("USER", "uzorrilla");
            })).Build();

            (await store.FindParameterAsync("USER", featureName, typeof(UserActivator).Name))
            .Should().NotBeNull();

            (await store.FindParameterAsync("USER", featureName, typeof(UserActivator).Name)).Name
            .Should().Be("USER");

            (await store.FindParameterAsync("USER", featureName, typeof(UserActivator).Name)).FeatureName
            .Should().Be(featureName);

            (await store.FindParameterAsync("USER", featureName, typeof(UserActivator).Name)).ActivatorType
            .Should().Be(typeof(UserActivator).Name);

            (await store.FindParameterAsync("USER", featureName, typeof(UserActivator).Name)).Value
            .Should().Be("uzorrilla");
        }