public void HeaderAndValueConditionNotExistsButNotExists() { List<Header> headers = new List<Header>(); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", "TheValue", ComparisonType.NotExists); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void HeaderAndValueImplicitNoneIsSkipped() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", "TheValue", Persistence.None); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void HeaderAndValueImplicitExists() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", "TheValue"); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void OneHeaderOnlyUrlEncodedNotMatch() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheH%2feader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheH/eader", ComparisonType.Exists); Assert.IsFalse(Evaluator.Matches(c, headers)); }
public void TwoConditionsSameHeaderNameDifferentValuesMatchesLast() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue1")); headers.Add(new Header("TheHeader", "TheValue2")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", "TheValue2"); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void OneHeaderMatchesCaseSensitive() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", "TheValue"); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void OneHeaderOnlyExistsComparisonCaseSensitive2() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheHEader", ComparisonType.Exists | ComparisonType.CaseSensitive); Assert.IsFalse(Evaluator.Matches(c, headers)); }
public void OneHeaderAndValueOnlyUrlEncodedMatch() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheH%2feader", "TheV%2falue")); SimulationCondition c = new SimulationCondition(); c.Header("TheH/eader", "TheV/alue", ComparisonType.Exists | ComparisonType.UrlEncode); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void OneHeaderExistsComparison() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", "TheValue", ComparisonType.Exists); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void OneConditionMatchesAgainstTwoSecond() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); headers.Add(new Header("TheHeader2", "TheValue2")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader2", "TheValue2"); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void NullHeadersAlwaysMatches() { SimulationCondition c = new SimulationCondition(); Assert.IsTrue(Evaluator.Matches(c, (IEnumerable<Header>) null)); c.Header("TheHeader", "Woo"); Assert.IsTrue(Evaluator.Matches(c, (IEnumerable<Header>)null)); }
public void HeaderPartialValueMatchCaseSensitive() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", "eVal", ComparisonType.PartialValue); Assert.IsTrue(Evaluator.Matches(c, headers)); }
public void HeaderOnlyNotExistsImplicitNoHeaders() { List<Header> headers = new List<Header>(); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader"); Assert.IsFalse(Evaluator.Matches(c, headers)); }
public void HeaderOnlyNotExists() { List<Header> headers = new List<Header>(); headers.Add(new Header("TheHeader", "TheValue")); SimulationCondition c = new SimulationCondition(); c.Header("TheHeader", ComparisonType.NotExists); Assert.IsFalse(Evaluator.Matches(c, headers)); }