コード例 #1
0
        public void DetailsTest_Methods()
        {
            Address           location    = new Address("Leusrhoek", "Gent", "20");
            List <Arangement> arangements = new List <Arangement>()
            {
                new Wedding(2000)
            };
            Limousine limousine   = new Limousine(200, "Tesla - X", 2, arangements);
            DateTime  dateNeeded  = new DateTime(10, 2, 23, 10, 0, 0);
            string    arrangement = "Wedding";
            Details   details     = new Details(location, location, limousine, dateNeeded, arrangement);

            Address address   = new Address("Leusrhoek", "Beveren", "20");
            var     discounts = Parser.GetDiscounts().Where(d => d.ClientType == ClientType.Vip).ToList();
            Client  test      = new Client(ClientType.Vip, Parser.GetDiscounts().Where(s => s.ClientType.Equals("Vip")).ToList(), new Address("Leurshoek", "Beveren", "61"), "Vip", "0862333424", new List <ReservationsPerYear>());

            int   subTotal         = 2000;
            float usedDiscount     = 0;
            int   amountWithoutBtw = 2000;
            int   btwAmount        = 120;
            int   toPay            = 2120;

            details.CalculatePrices(test, startHour: new TimeSpan(7, 0, 0));

            details.SubTotal.Should().Be(subTotal);
            details.UsedDiscount.Should().Be(usedDiscount);
            details.AmountWithoutBtw.Should().Be(amountWithoutBtw);
            details.BtwAmount.Should().Be(btwAmount);
            details.ToPayAmount.Should().Be(toPay);
        }