示例#1
0
            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));
            }
示例#2
0
        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));
        }
示例#3
0
            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));
            }
示例#4
0
        private ApiResponse WhenTryPost(ApiServiceSaveCommand command, SetupData setup)
        {
            var json = JsonSerialiser.Serialise(command);

            return(WhenTryPost(json, setup));
        }
示例#5
0
 private ApiResponse WhenTryCreateService(ApiServiceSaveCommand command, SetupData setup)
 {
     return(WhenTryPost(command, setup));
 }