コード例 #1
0
        public MaintenanceJobPlanned Build()
        {
            var customer = CustomerBuilder
                           .Build();

            var vehicle = VehicleBuilder
                          .WithOwnerId(customer.Id)
                          .Build();

            var job = MaintenanceJobBuilder
                      .WithCustomer(customer)
                      .WithVehicle(vehicle)
                      .Build();

            MaintenanceJobPlanned e = new MaintenanceJobPlanned(
                Guid.NewGuid(), job.Id, job.StartTime, job.EndTime,
                (customer.Id, customer.Name, customer.TelephoneNumber),
                (vehicle.Id, vehicle.Brand, vehicle.Type),
                job.Description
                );

            return(e);
        }
コード例 #2
0
        public PlanMaintenanceJob Build()
        {
            var customer = CustomerBuilder
                           .Build();

            var vehicle = VehicleBuilder
                          .WithOwnerId(customer.Id)
                          .Build();

            var job = MaintenanceJobBuilder
                      .WithCustomer(customer)
                      .WithVehicle(vehicle)
                      .Build();

            PlanMaintenanceJob command = new PlanMaintenanceJob(
                Guid.NewGuid(), job.Id, job.PlannedTimeslot.StartTime, job.PlannedTimeslot.EndTime,
                (customer.Id, customer.Name, customer.TelephoneNumber),
                (vehicle.Id, vehicle.Brand, vehicle.Type),
                job.Description
                );

            return(command);
        }
コード例 #3
0
 private void SetDefaults()
 {
     CustomerBuilder       = new CustomerBuilder();
     VehicleBuilder        = new VehicleBuilder();
     MaintenanceJobBuilder = new MaintenanceJobBuilder();
 }
コード例 #4
0
 public MaintenanceJobPlannedEventBuilder WithEndTime(DateTime endTime)
 {
     MaintenanceJobBuilder.WithEndTime(endTime);
     return(this);
 }
コード例 #5
0
 public MaintenanceJobPlannedEventBuilder WithStartTime(DateTime startTime)
 {
     MaintenanceJobBuilder.WithStartTime(startTime);
     return(this);
 }
コード例 #6
0
 public MaintenanceJobPlannedEventBuilder WithJobId(Guid jobId)
 {
     MaintenanceJobBuilder.WithJobId(jobId);
     return(this);
 }
コード例 #7
0
 public PlanMaintenanceJobCommandBuilder WithMaintenanceJobBuilder(MaintenanceJobBuilder maintenanceJobBuilder)
 {
     MaintenanceJobBuilder = maintenanceJobBuilder;
     return(this);
 }