public async Task BadRequestWhenMultipleAmountsProvided()
        {
            // Arrange
            var request = WorkOrderHelpers.CreateWorkOrderGenerator <ScheduleRepair>().Generate();

            request.WorkElement.First().RateScheduleItem.First().Quantity.Amount.Add(3.5);

            // Act
            var code = await Post("/api/v2/workOrders/schedule", request);

            // Assert
            code.Should().Be(HttpStatusCode.BadRequest);
        }
        private async Task <CreateOrderResult> CreateWorkOrder(Action <ScheduleRepair> interceptor = null)
        {
            var request = WorkOrderHelpers.CreateWorkOrderGenerator <ScheduleRepair>()
                          .AddValue(new List <double>
            {
                1
            }, (RateScheduleItem rsi) => rsi.Quantity.Amount)
                          .Generate();

            interceptor?.Invoke(request);

            var(_, response) = await Post <CreateOrderResult>("/api/v2/workOrders/schedule", request);

            return(response);
        }
        public async Task ScheduleRepair(string userGroup)
        {
            // Arrange
            SetUserRole(userGroup);
            var request = WorkOrderHelpers.CreateWorkOrderGenerator <ScheduleRepair>()
                          .AddValue(new List <double>
            {
                1
            }, (RateScheduleItem rsi) => rsi.Quantity.Amount)
                          .Generate();

            // Act
            var(code, response) = await Post <CreateOrderResult>("/api/v2/workOrders/schedule", request);

            // Assert
            code.Should().Be(HttpStatusCode.OK);
            var wo = GetWorkOrderFromDB(response.Id);

            wo.StatusCode.Should().Be(WorkStatusCode.Open);
            wo.WorkPriority.NumberOfDays.Should().Be(request.Priority.NumberOfDays);
        }