public void ReturnExcessTicketsAndPrice_WhenZoneIsLimeAndWeightIsX()
        {
            // Arrange
            //ParcelQuoteFromNelson pqfn = new ParcelQuoteFromNelson();
            // Act
            ParcelQuoteResult ActualParcelQuote = pqfn.CalculateQuote(Weight, "Lime");

            // Assert
            Assert.AreEqual(1, ActualParcelQuote.ExcessTickets);
            Assert.AreEqual(14.90m, ActualParcelQuote.Price);
        }
Exemplo n.º 2
0
        public void GetTicketPriceOfReeftonDos()
        {
            //arrange
            ParcelQuoteFromNelson quoteFromReefton = new ParcelQuoteFromNelson();

            //act
            ParcelQuoteResult quoteResult = quoteFromReefton.CalculateQuote(22, "Orange");

            //assert
            Assert.AreEqual(2, quoteResult.ExcessTickets);
            Assert.AreEqual(25.35m, quoteResult.Price);
        }
Exemplo n.º 3
0
        public void GetTicketPriceOfMurchisonOno()
        {
            //arrange
            ParcelQuoteFromNelson quoteFromMurchison = new ParcelQuoteFromNelson();

            //act
            ParcelQuoteResult quoteResult = quoteFromMurchison.CalculateQuote(16, "Lime");

            //assert
            Assert.AreEqual(1, quoteResult.ExcessTickets);
            Assert.AreEqual(14.90m, quoteResult.Price);
        }
        public void ReturnTicketPrice_ToOrangeZone()
        {
            //Arrange
            ParcelQuoteFromNelson lcQuoteFromNelson = new ParcelQuoteFromNelson();

            //Act
            ParcelQuoteResult lcQuoteResult = lcQuoteFromNelson.CalculateQuote(0.001m, "Orange"); //weight, destination zone

            //Assert
            Assert.AreEqual(0, lcQuoteResult.ExcessTickets); //excess tickets
            Assert.AreEqual(12.95m, lcQuoteResult.Price);    //total price
        }
Exemplo n.º 5
0
        public void GetTicketPriceOfHavelock()
        {
            //arrange
            ParcelQuoteFromNelson quoteFromHavelock = new ParcelQuoteFromNelson();

            //act
            ParcelQuoteResult quoteResult = quoteFromHavelock.CalculateQuote(12, "Blue");

            //assert
            Assert.AreEqual(0, quoteResult.ExcessTickets);
            Assert.AreEqual(6.95m, quoteResult.Price);
        }
Exemplo n.º 6
0
        public void GetTicketPriceOfNelson()
        {
            //arrange
            ParcelQuoteFromNelson quoteFromNelson = new ParcelQuoteFromNelson();

            //act
            ParcelQuoteResult quoteResult = quoteFromNelson.CalculateQuote(12, "Pink");

            //assert
            Assert.AreEqual(0, quoteResult.ExcessTickets);
            Assert.AreEqual(4.15m, quoteResult.Price);
        }
        public void ReturnPriceAndExcessTicket_WhenOrange20To25()
        {
            //arrange
            var     PQ     = new ParcelQuoteFromNelson();
            decimal Weight = 20M;
            string  Zone   = "Orange";

            //act
            ParcelQuoteResult QuoteResult = PQ.CalculateQuote(Weight, Zone);

            //assert
            Assert.AreEqual(2, QuoteResult.ExcessTickets);
            Assert.AreEqual(25.35M, QuoteResult.Price);
        }
        public void ReturnPriceAndExcessTicket_WhenLime15To20()
        {
            //arrange
            var     PQ     = new ParcelQuoteFromNelson();
            decimal Weight = 15M;
            string  Zone   = "Lime";

            //act
            ParcelQuoteResult QuoteResult = PQ.CalculateQuote(Weight, Zone);

            //assert
            Assert.AreEqual(1, QuoteResult.ExcessTickets);
            Assert.AreEqual(14.9M, QuoteResult.Price);
        }
        public void ReturnPriceAndExcessTicket_WhenBlue10To15()
        {
            //arrange
            var     PQ     = new ParcelQuoteFromNelson();
            decimal Weight = 10M;
            string  Zone   = "Blue";

            //act
            ParcelQuoteResult QuoteResult = PQ.CalculateQuote(Weight, Zone);

            //assert
            Assert.AreEqual(0, QuoteResult.ExcessTickets);
            Assert.AreEqual(6.95M, QuoteResult.Price);
        }
        public void ReturnPriceAndExcessTicket_WhenPink5To10()
        {
            //arrange
            var     PQ     = new ParcelQuoteFromNelson();
            decimal Weight = 5M;
            string  Zone   = "Pink";

            //act
            ParcelQuoteResult QuoteResult = PQ.CalculateQuote(Weight, Zone);

            //assert
            Assert.AreEqual(0, QuoteResult.ExcessTickets);
            Assert.AreEqual(4.15M, QuoteResult.Price);
        }
        public void Fail_WhenParcelWeightIsOutsideMinimumLegalLowerBoundaries()
        {
            // Arrange
            ParcelQuoteFromNelson fastwayCourier = new ParcelQuoteFromNelson();

            // Act
            decimal           nonLegalMinLowerBoundWeight = 0.0m;
            decimal           parcelPrice     = 8.70m;
            string            zoneDestination = fastwayCourier.GetDestinationZone("Murchison");
            ParcelQuoteResult parcelQuote     = fastwayCourier.CalculateQuote(nonLegalMinLowerBoundWeight, zoneDestination);

            // Assert
            Assert.AreEqual(parcelPrice, parcelQuote.Price);
        }
        public void Fail_WhenParcelWeightIsOutsideMaximumLegalUpperBoundaries()
        {
            // Arrange
            ParcelQuoteFromNelson fastwayCourier = new ParcelQuoteFromNelson();

            // Act
            decimal           nonLegalMaxUpperBoundWeight = 26.1m;
            decimal           parcelPrice     = 19.15m;
            string            zoneDestination = fastwayCourier.GetDestinationZone("Reefton");
            ParcelQuoteResult parcelQuote     = fastwayCourier.CalculateQuote(nonLegalMaxUpperBoundWeight, zoneDestination);

            // Assert
            Assert.AreEqual(parcelPrice, parcelQuote.Price);
        }
        public void Fail_WhenParcelWeightIsOutsideMaximumLegalLowerBoundairesWithNoExcessLabel()
        {
            // Arrange
            ParcelQuoteFromNelson fastwayCourier = new ParcelQuoteFromNelson();

            // Act
            decimal           nonLegalMaxLowerBoundWeight = 15.4m;
            decimal           parcelPrice     = 12.95m;
            string            zoneDestination = fastwayCourier.GetDestinationZone("Reefton");
            ParcelQuoteResult parcelQuote     = fastwayCourier.CalculateQuote(nonLegalMaxLowerBoundWeight, zoneDestination);

            // Assert
            Assert.AreEqual(parcelPrice, parcelQuote.Price);
        }
        public void Return_TwoTickets_WhenParcelPropertiesWithinLegalUpperBoundariesAndExceedsOneTicketWeightBoundaries()
        {
            // Arrange
            ParcelQuoteFromNelson fastwayCourier = new ParcelQuoteFromNelson();

            // Act
            int               rngLegalUpperBoundWeight = new Random().Next(21, 25);
            byte              legalExcessTicket        = 2;
            string            zoneDestination          = fastwayCourier.GetDestinationZone("Reefton");
            ParcelQuoteResult parcelQuote = fastwayCourier.CalculateQuote(rngLegalUpperBoundWeight, zoneDestination);

            // Assert
            Assert.AreEqual(legalExcessTicket, parcelQuote.ExcessTickets);
        }
        public void Return_12_95_WhenParcelPropertiesWithinLegalLowerBoundaries()
        {
            // Arrange
            ParcelQuoteFromNelson fastwayCourier = new ParcelQuoteFromNelson();

            // Act
            int               rngLegalLowerBoundWeight = new Random().Next(1, 15);
            decimal           parcelPrice     = 12.95m;
            string            zoneDestination = fastwayCourier.GetDestinationZone("Reefton");
            ParcelQuoteResult parcelQuote     = fastwayCourier.CalculateQuote(rngLegalLowerBoundWeight, zoneDestination);

            // Assert
            Assert.AreEqual(parcelPrice, parcelQuote.Price);
        }
        public void ReturnArgumentException_WhenOrangeGreaterThan25()
        {
            //arrange
            var     PQ     = new ParcelQuoteFromNelson();
            decimal Weight = 25.1M;
            string  Zone   = "Orange";

            //act
            ParcelQuoteResult QuoteResult = PQ.CalculateQuote(Weight, Zone);

            //assert
            Assert.AreEqual("ArgumentOutOfRangeException", QuoteResult.ExcessTickets);
            Assert.AreEqual("ArgumentOutOfRangeException", QuoteResult.Price);
        }
        public void bReturnBugPrice_WhenWeightOutsideHigherEdgeOfValidRange()
        {
            // Arrange.
            ParcelQuoteFromNelson parcelQuote = new ParcelQuoteFromNelson();
            decimal weight = 25.01m;
            string  zone   = "blue";

            decimal expectedStandardPrice = 6.85m;
            byte    expectedExcessTickets = 0;

            // Act.
            ParcelQuoteResult parcelQuoteResult = parcelQuote.CalculateQuote(weight, zone);

            // Assert.
            Assert.AreEqual(expectedStandardPrice, parcelQuoteResult.Price);
            Assert.AreEqual(expectedExcessTickets, parcelQuoteResult.ExcessTickets);
        }
Exemplo n.º 18
0
        public void oReturnStandardPrice_WhenWeightAtHigherBoundaryOfStandardRangeTwoTicket()
        {
            // Arrange.
            ParcelQuoteFromNelson parcelQuote = new ParcelQuoteFromNelson();
            decimal weight = 25.00m;
            string  zone   = "orange";

            decimal expectedStandardPrice = 25.35m;
            byte    expectedExcessTickets = 2;

            // Act.
            ParcelQuoteResult parcelQuoteResult = parcelQuote.CalculateQuote(weight, zone);

            // Assert.
            Assert.AreEqual(expectedStandardPrice, parcelQuoteResult.Price);
            Assert.AreEqual(expectedExcessTickets, parcelQuoteResult.ExcessTickets);
        }
Exemplo n.º 19
0
        public void oReturnStandardPrice_WhenWeightAtLowerEdgeOfStandardRangeOneTicket()
        {
            // Arrange.
            ParcelQuoteFromNelson parcelQuote = new ParcelQuoteFromNelson();
            decimal weight = 15.01m;
            string  zone   = "orange";

            decimal expectedStandardPrice = 19.15m;
            byte    expectedExcessTickets = 1;

            // Act.
            ParcelQuoteResult parcelQuoteResult = parcelQuote.CalculateQuote(weight, zone);

            // Assert.
            Assert.AreEqual(expectedStandardPrice, parcelQuoteResult.Price);
            Assert.AreEqual(expectedExcessTickets, parcelQuoteResult.ExcessTickets);
        }
Exemplo n.º 20
0
        public void lReturnStandardPrice_WhenWeightAtHigherEdgeOfStandardRange()
        {
            // Arrange.
            ParcelQuoteFromNelson parcelQuote = new ParcelQuoteFromNelson();
            decimal weight = 14.99m;
            string  zone   = "lime";

            decimal expectedStandardPrice = 8.70m;
            byte    expectedExcessTickets = 0;

            // Act.
            ParcelQuoteResult parcelQuoteResult = parcelQuote.CalculateQuote(weight, zone);

            // Assert.
            Assert.AreEqual(expectedStandardPrice, parcelQuoteResult.Price);
            Assert.AreEqual(expectedExcessTickets, parcelQuoteResult.ExcessTickets);
        }
        public void pReturnStandardPrice_WhenWeightAtLowerValidRange()
        {
            // Arrange.
            ParcelQuoteFromNelson parcelQuote = new ParcelQuoteFromNelson();
            decimal weight = 0m;
            string  zone   = "pink";

            decimal expectedStandardPrice = 4.15m;
            byte    expectedExcessTickets = 0;

            // Act.
            ParcelQuoteResult parcelQuoteResult = parcelQuote.CalculateQuote(weight, zone);

            // Assert.
            Assert.AreEqual(expectedStandardPrice, parcelQuoteResult.Price);
            Assert.AreEqual(expectedExcessTickets, parcelQuoteResult.ExcessTickets);
        }