private static void SimulateAddingPoints() { var dataService = new FakeLoyaltyDataService(); // 模拟数据库服务 var service = new LoyaltyAccrualService(dataService); var agreement = new RentalAgreement { Customer = new Customer { Id = Guid.NewGuid(), Name = "Jackie", DateOfBirth = new DateTime(1999, 1, 1), DriversLicense = "12345678" }, Vehicle = new Vehicle { Id = Guid.NewGuid(), Make = "Ford", Model = "小奔", Size = Size.Compact, Vin = "粤BABC12" }, StartDate = DateTime.Now.AddDays(-3), EndDate = DateTime.Now, Id = Guid.NewGuid() }; service.Accrue(agreement); }
private static void SimulateAddingPoints() { var dataService = new FakeLoyaltyDataService(); var service = new LoyaltyAccrualService(dataService); var rentalAgreement = new RentalAgreement { Customer = new Customer { Id = Guid.NewGuid(), Name = "Test name 1", DateOfBirth = new DateTime(1980, 2, 10), DriversLicense = "RR123456" }, Vehicule = new Vehicule { Id = new Guid(), Make = "Honda", Model = "Accord", Size = Size.Compact, Vin = "1HABBC123" }, StartDate = DateTime.Now.AddDays(-3), EndDate = DateTime.Now }; service.Accrue(rentalAgreement); }
/// <summary> /// 模拟累积积分 /// </summary> static void SimulateAddingPoints() { var dataService = new FakeLoyalDataService();//这里使用的数据库服务是伪造的 var service = new LoyaltyAccrualService(dataService); var agreement = new RentalAgreement { Customer = new Customer { Id = Guid.NewGuid(), Name = "tkb至简", DateOfBirth = new DateTime(2000, 1, 1), DriversLicense = "123456" }, Vehicle = new Vehicle { Id = Guid.NewGuid(), Make = "Ford", Model = "金牛座", Size = Size.Compact, Vin = "浙-ABC123" }, StartDate = DateTime.Now.AddDays(-3), EndDate = DateTime.Now }; service.Accrue(agreement); }