Ejemplo n.º 1
0
        private static void SimulateRemovingPoints()
        {
            var dataService = new FakeLoyaltyDataService();
            var service     = new LoyaltyRedemptionService(dataService);

            var invoice = new Invoice {
                Customer = new Customer {
                    Id             = Guid.NewGuid(),
                    Name           = "Test name 2",
                    DateOfBirth    = new DateTime(1977, 4, 15),
                    DriversLicense = "RR009911"
                },
                Vehicule = new Vehicule {
                    Id    = new Guid(),
                    Make  = "Cadillac",
                    Model = "Sedan",
                    Size  = Size.Luxury,
                    Vin   = "2BDI"
                },
                CostPerDay = 29.95m,
                Id         = Guid.NewGuid()
            };

            service.Redeem(invoice, 3);
        }
Ejemplo n.º 2
0
        static void StimulateRemovePoints()
        {
            var dataService = new FakeLoyaltyDataService();
            var service     = new LoyaltyRedemptionService(dataService);
            var invoice     = new Invoice
            {
                Id         = Guid.NewGuid(),
                CostPerDay = 29.95m,
                Customer   = new Customer
                {
                    Id            = Guid.NewGuid(),
                    BirthDate     = DateTime.Now.AddYears(-25),
                    DriverLicense = "DL0012345",
                    Name          = "John Papa"
                },
                Vehicle = new Vehicle
                {
                    Id    = Guid.NewGuid(),
                    Make  = "Honda",
                    Model = "SUV",
                    Size  = Size.Luxury
                }
            };

            service.Redeem(invoice, 3);
        }
Ejemplo n.º 3
0
        private static void SimulateSubstractPoints()
        {
            var dataService = new FakeLoyaltyDataService(); // 模拟数据库服务
            var service     = new LoyaltyRedemptionService(dataService);
            var invoice     = new Invoice
            {
                Customer = new Customer
                {
                    Id             = Guid.NewGuid(),
                    Name           = "Katty",
                    DateOfBirth    = new DateTime(1998, 1, 1),
                    DriversLicense = "654321"
                },
                Vehicle = new Vehicle
                {
                    Id    = Guid.NewGuid(),
                    Make  = "奥迪",
                    Model = "Q7",
                    Size  = Size.SUV,
                    Vin   = "粤B89898"
                },
                CostPerDay = 100,
                Id         = Guid.NewGuid()
            };

            service.Rdeem(invoice, 3); // 兑换3天
        }