Exemplo n.º 1
0
        public void Calculate_Calls_TotalCalulator_Calculate()
        {
            // Arrange
            var items = new IReceiptItem[0];

            m_List.Items.Returns(items);

            // Act
            m_Sut.Calculate();

            // Assert
            m_TotalCalculator.Received().Calculate(items);
        }
Exemplo n.º 2
0
        public void Calculate_Calls_TotalCalulator_SubTotal()
        {
            // Arrange
            m_SubTotalCalculator.Total.Returns(123.0d);

            var items = new IReceiptItem[0];

            m_List.Items.Returns(items);

            // Act
            m_Sut.Calculate();

            // Assert
            Assert.True(Math.Abs(123.0d - m_TotalCalculator.SubTotal) < Delta);
        }
        public void Calculate_Updates_Total()
        {
            // Arrange
            var items = new IReceiptItem[]
            {
                new ReceiptItem(1,
                                "One",
                                2.0d),
                new ReceiptItem(3,
                                "Two",
                                4.0d)
            };

            var sut = new TaxTotalCalulator();

            // Act
            sut.Calculate(items);

            // Assert
            Assert.True(Math.Abs(1.4d - sut.Total) < Delta);
        }
Exemplo n.º 4
0
 public void AddItem(IReceiptItem item)
 {
     m_Items.Add(item);
 }