Beispiel #1
0
        public void GetTotalPrice_ForItemB_Returns30()
        {
            //Arrange
            var sut = new Checkout.Checkout();

            //Act
            sut.Scan("B");
            var result = sut.GetTotalPrice();

            //Assert
            Assert.That(result, Is.EqualTo(30));
        }
Beispiel #2
0
        public void GetTotalPrice_ForTwoItemA_Returns100()
        {
            //Arrange
            var sut = new Checkout.Checkout();

            //Act
            sut.Scan("A");
            sut.Scan("A");
            var result = sut.GetTotalPrice();

            //Assert
            Assert.That(result, Is.EqualTo(100));
        }
Beispiel #3
0
        public void When_TheTotalIsRequestedItReturnsTheTotalAmount()
        {
            //--ARRANGE--
            var checkout = new Checkout.Checkout();

            checkout.Scan("A");
            checkout.Scan("B");

            //--ACT--
            var total = checkout.GetTotalPrice();

            //--ASSERT--
            Assert.True(total > 0);
        }
Beispiel #4
0
        public void GetTotalPrice_ForOneOfEachItem_Returns115()
        {
            //Arrange
            var sut = new Checkout.Checkout();

            //Act
            sut.Scan("A");
            sut.Scan("B");
            sut.Scan("C");
            sut.Scan("D");
            var result = sut.GetTotalPrice();

            //Assert
            Assert.That(result, Is.EqualTo(115));
        }
Beispiel #5
0
        public void When_AnOfferISAvailableItShouldBeApplied()
        {
            //--ARRANGE--
            var checkout = new Checkout.Checkout();

            checkout.Scan("B");
            checkout.Scan("A");
            checkout.Scan("B");

            //--ACT--
            var total = checkout.GetTotalPrice();

            //--ASSERT--
            Assert.True(total > 0);
            Assert.Equal(95, total);
        }