private string GivenWantToUpdateExistingService(SetupData setup) { var command = new ApiServiceSaveCommand { id = setup.MiniRed.Id, name = "Mini Yellow", description = "Mini Yellow Service", timing = new ApiServiceTiming { duration = 60 }, booking = new ApiServiceBooking { studentCapacity = 12, isOnlineBookable = true }, presentation = new ApiPresentation { colour = "Yellow" }, repetition = new ApiServiceRepetition { sessionCount = 9, repeatFrequency = "d" }, pricing = new ApiPricing { sessionPrice = 10, coursePrice = 80 } }; return(JsonSerialiser.Serialise(command)); }
private static string CreateNewServiceSaveCommand(ExpectedService expectedService) { var command = new ApiServiceSaveCommand { name = expectedService.Name, description = expectedService.Description, repetition = expectedService.Repetition, presentation = expectedService.Presentation }; if (expectedService.Timing != null) { command.timing = expectedService.Timing; } if (expectedService.Pricing != null) { command.pricing = expectedService.Pricing; } if (expectedService.Booking != null) { command.booking = expectedService.Booking; } return(JsonSerialiser.Serialise(command)); }
private string GivenValidServiceSaveCommand() { var command = new ApiServiceSaveCommand { name = "Mini Orange", description = "Mini Orange Service", repetition = new ApiServiceRepetition { sessionCount = 1 }, presentation = new ApiPresentation { colour = "orange" } }; return(JsonSerialiser.Serialise(command)); }
private ApiResponse WhenTryPost(ApiServiceSaveCommand command, SetupData setup) { var json = JsonSerialiser.Serialise(command); return(WhenTryPost(json, setup)); }
private ApiResponse WhenTryCreateService(ApiServiceSaveCommand command, SetupData setup) { return(WhenTryPost(command, setup)); }