예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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());
        }
예제 #4
0
 public void Teardown()
 {
     SUT = null;
 }
예제 #5
0
 public void Setup()
 {
     SUT = new AbsoluteNumber(new RealNumber(1));
 }
예제 #6
0
 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);
 }