Locate() public method

Locates a feature toggle with the strategy as indicated by this type.
public Locate ( ) : IFeatureToggle
return IFeatureToggle
コード例 #1
0
        public void Locate_Returns_Null_For_Toggles_Not_Found()
        {
            var featureConfiguration = new FeatureConfiguration();

            var locator = new LocateByNameStrategy(featureConfiguration, "idontexist");
            Assert.IsNull(locator.Locate());
        }
コード例 #2
0
        public void Can_Find_Feature_Toggle_By_Name()
        {
            const string toggleName = "testName";

            var toggle = new BooleanToggle(toggleName, true);

            var featureConfiguration = new FeatureConfiguration { toggle };

            var locator = new LocateByNameStrategy(featureConfiguration, toggleName);
            Assert.AreSame(toggle, locator.Locate());
        }