示例#1
0
        public void constructor_should_set_right_number()
        {
            // Given
            var nbr = new Variable("a", new RealNumber(1));

            // When
            SUT = new Division(new Variable("b", new RealNumber(1)), nbr);

            // Then
            Assert.AreSame(nbr, SUT.RightSide);
        }
示例#2
0
        public void calculate_should_return_real_number_with_division_value()
        {
            // Given
            SUT = new Division(new RealNumber(2.0), new RealNumber(6.0));

            // When
            var result = SUT.Calculate();

            // Then
            Assert.IsInstanceOf<RealNumber>(result);
        }
示例#3
0
        public void calculate_should_return_number_that_is_the_division()
        {
            // Given
            SUT = new Division(new RealNumber(6.0), new RealNumber(2.0));

            // When
            var result = SUT.Calculate() as RealNumber;

            // Then
            Assert.AreEqual(3, result.Value);
        }
示例#4
0
        public void getRealNumber_should_return_number_that_is_the_division()
        {
            // Given
            SUT = new Division(new RealNumber(6.0), new RealNumber(2.0));

            // When
            var result = SUT.GetRealNumber();

            // Then
            Assert.AreEqual(3.0, result.Value);
        }
示例#5
0
 public void Teardown()
 {
     SUT = null;
 }
示例#6
0
 public void Setup()
 {
     SUT = new Division(new Variable("a", new RealNumber(1)), new Variable("b", new RealNumber(1)));
 }
示例#7
0
        public void regenerate_should_regenerate_right_number()
        {
            // Given
            var nbr = new Mock<Number>();
            SUT = new Division(new RealNumber(1), nbr.Object);

            // When
            SUT.Regenerate();

            // Then
            nbr.Verify(x => x.Regenerate());
        }