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

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

            // Then
            Assert.AreSame(nbr, SUT.RightSide);
        }
コード例 #2
0
        public void calculate_should_return_real_number_with_multi_value()
        {
            // Given
            SUT = new Multiplication(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_multi()
        {
            // Given
            SUT = new Multiplication(new RealNumber(2.0), new RealNumber(6.0));

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

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

            // When
            SUT.Regenerate();

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