Exemplo n.º 1
0
        public void CreateChangeCalculator_CalculateChangePriceAmountSubmitted_DisplayChangeOwed()
        {
            // Arrange
            int testPrice = 10;
            int testTendered = 30;
            ChangeCalculator newChangeCalculator = new ChangeCalculator(testPrice, testTendered);
            int resultPrice = newChangeCalculator.GetPrice();
            int resultTendered = newChangeCalculator.GetTendered();

            // Act
            int myResult = newChangeCalculator.ChangePrice(resultPrice, resultTendered);

            // Assert
            Assert.Equal(20, myResult);
        }
Exemplo n.º 2
0
        public void CreateChangeCalculator_AcceptPriceAndAmountTendered_DisplayPriceAndAmountTendered()
        {
            // Arrange
            int testPrice = 10;
            int testTendered = 20;

            // Act
            ChangeCalculator newChangeCalculator = new ChangeCalculator(testPrice, testTendered);
            int resultPrice = newChangeCalculator.GetPrice();
            int resultTendered = newChangeCalculator.GetTendered();

            // Assert
            Assert.Equal(10, resultPrice);
            Assert.Equal(20, resultTendered);
        }