Пример #1
0
        public void When_The_Points_Spent_Is_More_Than_The_Points_Earnt_An_Exception_Is_Thrown()
        {
            // Arrange
            var customer = new StubCustomer();
            customer.SetPointsEarned(5);
            customer.PointsSpent = 10;

            //Assert
            Assert.Throws(typeof (ArgumentOutOfRangeException), () => customer.GetPointsBalance());
        }
Пример #2
0
        public void AddingPointsToACustomerShouldIncreaseTheTotalPoints()
        {
            //Arrange
            var customer = new StubCustomer();

            //Act
            customer.AddPoints(6);

            //Assert
            Assert.AreEqual(6, customer.GetPointsEarned());
        }
Пример #3
0
        public void The_Balance_Is_Equal_To_The_Number_Of_Points_Earnt_Minus_Number_Of_Points_Spent()
        {
            //Arrange
            var customer = new StubCustomer();
            customer.SetPointsEarned(5);
            customer.PointsSpent = 3;

            //Act
            var result = customer.GetPointsBalance();

            //Assert
            Assert.AreEqual(2, result);
        }