Пример #1
0
        public void TestMultiplication()
        {
            Dollar five = new Dollar(5);

            Assert.Equal(new Dollar(10), five.Times(2));
            Assert.Equal(new Dollar(15), five.Times(3));
        }
Пример #2
0
        public void TestMulitiplication()
        {
            //Arrange
            Dollar five = new Dollar(5);

            //Assert
            Assert.AreEqual(new Dollar(10), five.Times(2));
            Assert.AreEqual(new Dollar(15), five.Times(3));
        }
        public void TestMultiplication_Fact()
        {
            Dollar five    = new Dollar(5);
            Dollar product = five.Times(2);

            Assert.Equal(10, product.Amount);
            product = five.Times(3);
            Assert.Equal(15, product.Amount);
        }
        public void TestFact02_MultiplicationAndDegenerateObjects()
        {
            Dollar five    = new Dollar(5);
            Dollar product = five.Times(2);

            Assert.Equal(10, product.Amount);
            product = five.Times(3);
            Assert.Equal(15, product.Amount);
        }
Пример #5
0
        public void TestMultiplication()
        {
            // test is not clean !
            Dollar five = Money.Dollar(5);

            Assert.Equal(Money.Dollar(10), five.Times(2));
            Assert.Equal(Money.Dollar(15), five.Times(3));

            //triagulation: test falsehood
            Assert.NotEqual(Money.Dollar(9), five.Times(2));
        }
        public void Money_dollar_Method_Should_Return_a_Instance_Of_Dollars()
        {
            // ARRANGE
            MoneyTDD money = new MoneyTDD();

            // ACT
            Dollar five = money.Dollar(5);

            // ASSERT
            five.Times(2).Should().Be(new Dollar(10));
            five.Times(3).Should().Be(new Dollar(15));
        }
Пример #7
0
 public void testMultiplication()
 {
     try
     {
         Dollar five = new Dollar(5);
         Assert.AreEqual(new Dollar(10), five.Times(2));
         Assert.AreEqual(new Dollar(15), five.Times(3));
     }
     catch (Exception e)
     {
         Assert.Fail();
     }
 }
Пример #8
0
        public void testMultiplication()
        {
            // Test is changed from last chapter.
            // Goal is to have the five Dollar object remain unchanged from the multiplication.
            //
            // This chapter shows the method of using 'Obvious Implementation' to make the test pass faster, rather than stubbing out behavior.
            // This is done by directly typing in the real implementation as the first step.
            Dollar five    = new Dollar(5);
            Dollar product = five.Times(2);

            Assert.AreEqual(10, product.Amount);
            product = five.Times(3);
            Assert.AreEqual(15, product.Amount);
        }
Пример #9
0
        public void testMultiplication()
        {
            Dollar five = new Dollar(5);

            five.Times(2);
            Assert.AreEqual(10, five.Amount);
        }
Пример #10
0
        public void TestMultiplication()
        {
            var five    = new Dollar(5);
            var product = five.Times(2);

            product.Amount.Should().Be(10);
        }
        public void TestFact01_Multiplication()
        {
            Money five    = new Dollar(5);
            Money product = five.Times(2);

            Assert.Equal(new Dollar(10), product);
        }
Пример #12
0
        public void TestMultiplication_Fact01()
        {
            Dollar five = new Dollar(5);

            five.Times(2);
            Assert.Equal(10, five.Amount);
        }
Пример #13
0
        public void ProvideTheCorrectAnswerToAMultiplication()
        {
            var five = new Dollar(5);

            five.Times(2);
            Assert.Equal(10, five.Amount);
        }
Пример #14
0
        public void Times_Money()
        {
            // Arrange
            var multiplier = 2;

            // Act
            var actual = _target.Times(multiplier);

            // Assert
            Assert.Equal(20, actual.Amount);
            Assert.Equal("USD", actual.Currency);
        }
Пример #15
0
        public void TimesTest()
        {
            var result = _target.Times(2);

            Assert.AreEqual(10, result);
        }