public void regenerate_should_regenerate_value() { // Given var nbr = new Mock<Number>(); SUT = new Variable("a", nbr.Object); // When SUT.Regenerate(); // Then nbr.Verify(x => x.Regenerate(), Times.Once); }
public void regenerate_should_not_set_new_value_that_does_not_match_conditions() { // Given var rand = new RandomInteger(1, 4); var leq = new LessThan(rand, new RealNumber(2)); SUT = new Variable("a", rand); SUT.SetConditions(leq); // When SUT.Regenerate(); // Then Assert.LessOrEqual(SUT.GetRealNumber().Value, 2.0); }