public void SetUp() { Matcher = new LessThanConstraint(5); GoodValues = new object[] { 4 }; BadValues = new object[] { 6, 5 }; Description = "less than 5"; }
public void SetUp() { Matcher = new LessThanConstraint(5); GoodValues = new object[] { 4 }; BadValues = new object[] { 6, 5, "big", null }; Description = "less than 5"; }
public void ShouldBeReturnedFalseWhenEvaluateLessThanConstraintAndValueIsADateGreaterThanConstraint() { var data = ObjectHelper.ToDictionary(new { Deadline = DateTime.Today.AddDays(1) }); var constraint = new LessThanConstraint("Deadline", DateTime.Today); var result = constraint.Evaluate(data); Assert.False(result); }
public void ShouldBeReturnedFalseWhenEvaluateLessThanConstraintAndPropertyNotExists() { var data = ObjectHelper.ToDictionary(new { }); var constraint = new LessThanConstraint("Age", 18); var result = constraint.Evaluate(data); Assert.False(result); }
public void ShouldBeReturnedFalseWhenEvaluateLessThanConstraintAndValueIsGreaterThanConstraint() { var data = ObjectHelper.ToDictionary(new { Age = 20 }); var constraint = new LessThanConstraint("Age", 18); var result = constraint.Evaluate(data); Assert.False(result); }
public void LessThenConstraintFalse() { IConstraint sut = new LessThanConstraint(10); Assert.IsFalse(sut.Validate(10)); }
public void LessThenConstraint() { IConstraint sut = new LessThanConstraint(10); Assert.IsTrue(sut.Validate(9)); }
public void SetUp() { theConstraint = comparisonConstraint = new LessThanConstraint(5); expectedDescription = "less than 5"; stringRepresentation = "<lessthan 5>"; }
public void TestThermometerSudoku() { // Thermometer Sudoku with givens; taken from Cracking the Cryptic: https://www.youtube.com/watch?v=RRSFXCpBBek // There’s also a version with more thermometers and no givens (https://www.youtube.com/watch?v=KTth49YrQVU) but it takes this solver several seconds. assertUniqueSolution( new Sudoku().AddGivens(".4.6.7.3...............................................7.....9....3.5.......1....").AddConstraints(LessThanConstraint.FromString("A2-6;C3-7;E2-8;G3-7;I2-6")), 9, 4, 8, 6, 2, 7, 1, 3, 5, 2, 6, 7, 5, 3, 1, 9, 8, 4, 5, 3, 1, 9, 4, 8, 2, 7, 6, 6, 9, 2, 8, 5, 4, 3, 1, 7, 7, 5, 3, 1, 6, 9, 4, 2, 8, 8, 1, 4, 2, 7, 3, 5, 6, 9, 3, 7, 5, 4, 8, 2, 6, 9, 1, 1, 8, 6, 3, 9, 5, 7, 4, 2, 4, 2, 9, 7, 1, 6, 8, 5, 3); }