public void ExpressionParser_AreAllSatisfied_1stEquation() { var parser = new EqualityParser(new [] { "a+a+a=60" }); parser.AreAllSatisfied(new Dictionary <char, double>() { ['a'] = 20 }).Should().BeTrue(); }
public void ExpressionParser_ParseAsPredicate_3rdEquation() { var parser = new EqualityParser(new [] { "c+c+b=10" }); parser.AreAllSatisfied(new Dictionary <char, double>() { ['b'] = 4, ['c'] = 3, }).Should().BeTrue(); }
public void ExpressionParser_ParseAsPredicate_2ndEquation() { var parser = new EqualityParser(new [] { "b+b+a=28" }); parser.AreAllSatisfied(new Dictionary <char, double>() { ['a'] = 20, ['b'] = 4, }).Should().BeTrue(); }
[Fact] public void EqualityParser_AreAllSatisfied_AllEquations() { var assignment = new Dictionary <char, double>() { ['a'] = 20, ['b'] = 4, ['c'] = 3, }; var parser = new EqualityParser(new [] { "a+a+a=60", "b+b+a=28", "c+c+b=10" }); parser.AreAllSatisfied(assignment).Should().BeTrue(); }