Esempio n. 1
0
        public void TestUnSuccessfullParseReturnsToggleStatusInactive()
        {
            IToggleParser testParser     = new ToggleParserTestDouble();
            var           toggle         = new FeatureToggle <bool>();
            var           toggleResponse = toggle.GetToggleState(testParser, "anythingElse");

            Assert.AreEqual(ToggleStatus.Inactive, toggleResponse);
        }
Esempio n. 2
0
        public void TestSuccessfullParseReturnsToggleStatusActive()
        {
            IToggleParser testParser     = new ToggleParserTestDouble();
            var           toggle         = new FeatureToggle <bool>();
            var           toggleResponse = toggle.GetToggleState(testParser, "positive");

            Assert.AreEqual(ToggleStatus.Active, toggleResponse);
        }
Esempio n. 3
0
        public void TestUnSuccessfullFuncTestDataTypeCallWhenToggleStatusInactive()
        {
            IToggleParser       testParser = new ToggleParserTestDouble();
            var                 toggle     = new FeatureToggle <TestDataType>();
            Func <TestDataType> theAction  = AlwaysReturnNewTestDataType;

            var toggleResponse = toggle.ExecuteMethodIfToggleOn(theAction, testParser, "anythingElse");

            Assert.IsNull(toggleResponse);
        }
Esempio n. 4
0
        public void TestSuccessfullFuncTestDataTypeCallWhenToggleStatusActive()
        {
            IToggleParser       testParser = new ToggleParserTestDouble();
            var                 toggle     = new FeatureToggle <TestDataType>();
            Func <TestDataType> theAction  = AlwaysReturnNewTestDataType;

            var toggleResponse = toggle.ExecuteMethodIfToggleOn(theAction, testParser, "positive");

            Assert.AreEqual(new TestDataType().HappynessIs, toggleResponse.HappynessIs);
        }
Esempio n. 5
0
        public void TestUnSuccessfullFuncStringCallWhenToggleStatusInactive()
        {
            IToggleParser testParser = new ToggleParserTestDouble();
            var           toggle     = new FeatureToggle <string>();
            Func <string> theAction  = AlwaysReturnFire;

            var toggleResponse = toggle.ExecuteMethodIfToggleOn(theAction, testParser, "anythingElse");

            Assert.AreNotEqual("Fire", toggleResponse);
        }
Esempio n. 6
0
        public void TestUnSuccessfullFuncCallWhenToggleStatusInactive()
        {
            IToggleParser testParser = new ToggleParserTestDouble();
            var           toggle     = new FeatureToggle <bool>();
            Func <bool>   theAction  = AlwaysReturnTrue;

            var toggleResponse = toggle.ExecuteMethodIfToggleOn(theAction, testParser, "anythingElse");

            Assert.AreEqual(false, toggleResponse);
        }