private List <WorkOrder> GenerateWorkOrders(int workOrderCount, WorkStatusCode workStatusCode, DateTime closedDate) { _generator.AddValue(workStatusCode, (RepairsApi.V2.Infrastructure.WorkOrder wo) => wo.StatusCode); _generator.AddValue(closedDate, (RepairsApi.V2.Infrastructure.WorkOrder wo) => wo.ClosedDate); var generatedWorkOrders = _generator.GenerateList(workOrderCount); foreach (var wo in generatedWorkOrders) { wo.Appointments.First().Date = DateTime.Today; } return(generatedWorkOrders); }
private static WorkOrder CreateOvertimeWorkOrder(Generator <WorkOrder> generator) { var expectedWorkOrder = generator? .AddValue(true, (WorkOrder wo) => wo.IsOvertime) .Generate(); return(expectedWorkOrder); }
private JobStatusUpdate CreateJobStatusUpdate() { return(_generator .AddValue(null, (JobStatusUpdate jsu) => jsu.AuthorName) .Ignore((WorkOrder wo) => wo.WorkOrderOperatives) .Ignore((WorkOrder wo) => wo.AssignedOperatives) .Ignore((WorkOrder wo) => wo.Appointments) .Generate()); }