public void getRealNumber_should_return_the_absolute_number() { // Given SUT = new AbsoluteNumber(new RealNumber(-2)); // When var result = SUT.GetRealNumber(); // Then Assert.AreEqual(2, result.Value); }
public void constructor_should_set_number() { // Given var nbr = new Variable("a", new RealNumber(1)); // When SUT = new AbsoluteNumber(nbr); // Then Assert.AreSame(nbr, SUT.InnerValue); }
public void regenerate_should_regenerate_the_number() { // Given var nbr = new Mock<Number>(); SUT = new AbsoluteNumber(nbr.Object); // When SUT.Regenerate(); // Then nbr.Verify(x => x.Regenerate()); }
public void Teardown() { SUT = null; }
public void Setup() { SUT = new AbsoluteNumber(new RealNumber(1)); }
public void constructor_should_throw_if_left_is_null() { var ex = Assert.Throws<ArgumentNullException>(() =>SUT= new AbsoluteNumber(null)); Assert.AreEqual("The number can't be null\r\nParameter name: nbr", ex.Message); }