public bool ReturnsSwitchState_DependantOnCookieValue(bool cookieValue) { var featureSwitch = new PercentageFeatureSwitch { IsEnabled = true, Name = "testPercentageFeatureSwitch" }; _cookies.Add(new HttpCookie(featureSwitch.Name, cookieValue.ToString())); return featureSwitch.IsOn(_femahContext); }
public void SetsCookie_IfNoCookieExists() { var featureSwitch = new PercentageFeatureSwitch { IsEnabled = true, Name = "testPercentageFeatureSwitch" }; var result = featureSwitch.IsOn(_femahContext); _cookies.Count.ShouldBe(1); _cookies[0].Name.ShouldBe(featureSwitch.Name); _cookies[0].Value.ShouldBe(result.ToString()); }