public void Example1() { const string ruleString = "toggle 0,0 through 99,99"; var rule = RuleInterpreter.Eval(ruleString); var newGrid = rule.ExecuteRule(LightGrid.Create(100, 100)); var lightsLit = newGrid.GetLights(); Assert.Equal(10000, lightsLit); }
public void ToggleRules_ReturnsToggleRule() { const string ruleString = "toggle 0,0 through 999,999"; var rule = RuleInterpreter.Eval(ruleString); var toggleRule = Assert.IsType <ToggleRule>(rule); Assert.Equal(0, toggleRule.From.X); Assert.Equal(0, toggleRule.From.Y); Assert.Equal(999, toggleRule.To.Y); Assert.Equal(999, toggleRule.To.Y); }