public void TestUnSuccessfullParseReturnsToggleStatusInactive() { IToggleParser testParser = new ToggleParserTestDouble(); var toggle = new FeatureToggle <bool>(); var toggleResponse = toggle.GetToggleState(testParser, "anythingElse"); Assert.AreEqual(ToggleStatus.Inactive, toggleResponse); }
public void TestSuccessfullParseReturnsToggleStatusActive() { IToggleParser testParser = new ToggleParserTestDouble(); var toggle = new FeatureToggle <bool>(); var toggleResponse = toggle.GetToggleState(testParser, "positive"); Assert.AreEqual(ToggleStatus.Active, toggleResponse); }
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); }
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); }
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); }
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); }