Esempio n. 1
0
        public async Task GolfClubController_POST_AddMeasuredCourseToGolfClub_MeasuredCourseIdIsReturned()
        {
            // 1. Arrange
            HttpClient client = this.WebApplicationFactory.CreateClient();

            AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest = TestData.AddMeasuredCourseToClubRequest;
            String uri = $"api/golfclubs/{TestData.GolfClubId}/measuredcourses";

            client.DefaultRequestHeaders.Add("api-version", "2.0");
            StringContent content = Helpers.CreateStringContent(addMeasuredCourseToClubRequest);

            // 2. Act
            HttpResponseMessage response = await client.PostAsync(uri, content, CancellationToken.None);

            // 3. Assert
            response.StatusCode.ShouldBe(HttpStatusCode.Created);

            String responseAsJson = await response.Content.ReadAsStringAsync();

            responseAsJson.ShouldNotBeNullOrEmpty();

            AddMeasuredCourseToClubResponse responseObject = JsonConvert.DeserializeObject <AddMeasuredCourseToClubResponse>(responseAsJson);

            responseObject.GolfClubId.ShouldBe(TestData.GolfClubId);
            responseObject.MeasuredCourseId.ShouldNotBe(Guid.Empty);
        }
        public async Task <IActionResult> AddMeasuredCourseToGolfClub([FromRoute] Guid golfClubId,
                                                                      [FromBody] AddMeasuredCourseToClubRequest request,
                                                                      CancellationToken cancellationToken)
        {
            // Get the Golf Club Id claim from the user
            Claim golfClubIdClaim = ClaimsHelper.GetUserClaim(this.User, CustomClaims.GolfClubId, golfClubId.ToString());

            Boolean validationResult = ClaimsHelper.ValidateRouteParameter(golfClubId, golfClubIdClaim);

            if (validationResult == false)
            {
                return(this.Forbid());
            }

            Guid golfClubIdValue  = Guid.Parse(golfClubIdClaim.Value);
            Guid measuredCourseId = Guid.NewGuid();

            // Create the command
            AddMeasuredCourseToClubCommand command = AddMeasuredCourseToClubCommand.Create(golfClubIdValue, measuredCourseId, request);

            // Route the command
            await this.CommandRouter.Route(command, cancellationToken);

            // return the result
            return(this.Created($"{GolfClubController.ControllerRoute}/{golfClubId}/measuredcourses/{measuredCourseId}",
                                new AddMeasuredCourseToClubResponse
            {
                GolfClubId = golfClubIdValue,
                MeasuredCourseId = measuredCourseId
            }));
        }
        /// <summary>
        /// Adds the measured course to golf club.
        /// </summary>
        /// <param name="accessToken">The access token.</param>
        /// <param name="golfClubId">The golf club identifier.</param>
        /// <param name="request">The request.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns></returns>
        public async Task AddMeasuredCourseToGolfClub(String accessToken,
                                                      Guid golfClubId,
                                                      AddMeasuredCourseToClubRequest request,
                                                      CancellationToken cancellationToken)
        {
            String requestUri = $"{this.BaseAddress}/api/GolfClub/{golfClubId}/AddMeasuredCourse";

            try
            {
                String requestSerialised = JsonConvert.SerializeObject(request);

                StringContent httpContent = new StringContent(requestSerialised, Encoding.UTF8, "application/json");

                // Add the access token to the client headers
                this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

                // Make the Http Call here
                HttpResponseMessage httpResponse = await this.HttpClient.PutAsync(requestUri, httpContent, cancellationToken);

                // Process the response
                String content = await this.HandleResponse(httpResponse, cancellationToken);

                // call was successful, no response data to deserialise
            }
            catch (Exception ex)
            {
                // An exception has occurred, add some additional information to the message
                Exception exception = new Exception("Error Adding a measured course to Golf Club.", ex);

                throw exception;
            }
        }
        /// <summary>
        /// Adds the measured course to golf club.
        /// </summary>
        /// <param name="accessToken">The access token.</param>
        /// <param name="golfClubId">The golf club identifier.</param>
        /// <param name="addMeasuredCourseToClubRequest">The add measured course to club request.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns></returns>
        public async Task AddMeasuredCourseToGolfClub(String accessToken,
                                                      Guid golfClubId,
                                                      AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest,
                                                      CancellationToken cancellationToken)
        {
            addMeasuredCourseToClubRequest.MeasuredCourseId = Guid.NewGuid();

            await this.GolfClubClient.AddMeasuredCourseToGolfClub(accessToken, golfClubId, addMeasuredCourseToClubRequest, cancellationToken);
        }
Esempio n. 5
0
        /// <summary>
        /// Creates the measured course.
        /// </summary>
        /// <param name="accessToken">The access token.</param>
        /// <param name="claimsIdentity">The claims identity.</param>
        /// <param name="viewModel">The view model.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        public async Task CreateMeasuredCourse(String accessToken,
                                               ClaimsIdentity claimsIdentity,
                                               MeasuredCourseViewModel viewModel,
                                               CancellationToken cancellationToken)
        {
            AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest = this.ModelFactory.ConvertFrom(viewModel);

            Guid golfClubId = ApiClient.GetClaimValue <Guid>(claimsIdentity, "GolfClubId");

            await this.GolfClubClient.AddMeasuredCourseToGolfClub(accessToken, golfClubId, addMeasuredCourseToClubRequest, cancellationToken);
        }
        public void WhenWithTheFollowingHoles(Table table)
        {
            foreach (TableRow tableRow in table.Rows)
            {
                AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest =
                    this.TestingContext.GetAddMeasuredCourseToClubRequest(tableRow["GolfClubNumber"], tableRow["MeasuredCourseNumber"]);

                addMeasuredCourseToClubRequest.Holes.Add(new HoleDataTransferObjectRequest
                {
                    HoleNumber     = Int32.Parse(tableRow["HoleNumber"]),
                    LengthInMeters = 0,
                    LengthInYards  = Int32.Parse(tableRow["LengthInYards"]),
                    Par            = Int32.Parse(tableRow["Par"]),
                    StrokeIndex    = Int32.Parse(tableRow["StrokeIndex"])
                });
            }
        }
        public void WhenIAddAMeasuredCourseToTheClubWithTheFollowingDetails(Table table)
        {
            foreach (TableRow tableRow in table.Rows)
            {
                AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest = new AddMeasuredCourseToClubRequest
                {
                    Name                 = tableRow["Name"],
                    MeasuredCourseId     = Guid.NewGuid(),
                    StandardScratchScore = Int32.Parse(tableRow["StandardScratchScore"]),
                    TeeColour            = tableRow["TeeColour"],
                    Holes                = new List <HoleDataTransferObjectRequest>()
                };

                this.TestingContext.AddMeasuredCourseToClubRequests.Add(new KeyValuePair <String, String>(tableRow["GolfClubNumber"],
                                                                                                          tableRow["MeasuredCourseNumber"]),
                                                                        addMeasuredCourseToClubRequest);
            }
        }
Esempio n. 8
0
        public async Task GolfClubClient_AddMeasuredCourseToGolfClub_MeasuredCourseIsCreated()
        {
            // 1. Arrange
            HttpClient            client         = this.WebApplicationFactory.AddGolfClubAdministrator().CreateClient();
            Func <String, String> resolver       = api => "http://localhost";
            IGolfClubClient       golfClubClient = new GolfClubClient(resolver, client);

            AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest = TestData.AddMeasuredCourseToClubRequest;

            String token =
                "eyJhbGciOiJSUzI1NiIsImtpZCI6ImVhZDQyNGJjNjI5MzU0NGM4MGFmZThhMDk2MzEyNjU2IiwidHlwIjoiSldUIn0.eyJuYmYiOjE1NzAyODk3MDksImV4cCI6MTU3MDI5MzMwOSwiaXNzIjoiaHR0cDovLzE5Mi4xNjguMS4xMzI6NTAwMSIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjEzMjo1MDAxL3Jlc291cmNlcyIsIm1hbmFnZW1lbnRhcGkiLCJzZWN1cmlydHlzZXJ2aWNlYXBpIl0sImNsaWVudF9pZCI6ImdvbGZoYW5kaWNhcC50ZXN0ZGF0YWdlbmVyYXRvciIsInNjb3BlIjpbIm1hbmFnZW1lbnRhcGkiLCJzZWN1cmlydHlzZXJ2aWNlYXBpIl19.vLfs2bOMXshW93nw5TTOqd6NPGNYpcrhcom8yZoYc9WGSuYH48VqM5BdbodEukNNJmgbV9wUVgoj1uGztlFfHGFA_q6IQfd3xZln_LIxju6ZNZs8qUyRXDTGxu0dlfF8STLfBUq469SsY9eNi1hBYFyNxl963OfKqDSHAdeBg9yNlwnbky1Tnsxobu9W33fLcjH0KoutlwTFV51UFUEKCBk0w1zsjaDVZacETn74t56y0CvMS7ZSN2_yyunq4JvoUsh3xM5lQ-gl23eQyo6l4QE4wukCS7U_Zr2dg8-EF63VKiCH-ZD49M76TD9kIIge-XIgHqa2Xf3S-FpLxXfEqw";

            // 2. Act
            AddMeasuredCourseToClubResponse addMeasuredCourseToClubResponse =
                await golfClubClient.AddMeasuredCourseToGolfClub(token, TestData.GolfClubId, addMeasuredCourseToClubRequest, CancellationToken.None);

            // 3. Assert
            addMeasuredCourseToClubResponse.GolfClubId.ShouldBe(TestData.GolfClubId);
            addMeasuredCourseToClubResponse.MeasuredCourseId.ShouldNotBe(Guid.Empty);
        }
        public async Task <IActionResult> AddMeasuredCourseToGolfClub([FromRoute] Guid golfClubId,
                                                                      [FromBody] AddMeasuredCourseToClubRequest request,
                                                                      CancellationToken cancellationToken)
        {
            // Get the Golf Club Id claim from the user
            Claim golfClubIdClaim = ClaimsHelper.GetUserClaim(this.User, CustomClaims.GolfClubId, golfClubId.ToString());

            Boolean validationResult = ClaimsHelper.ValidateRouteParameter(golfClubId, golfClubIdClaim);

            if (validationResult == false)
            {
                return(this.Forbid());
            }

            // Create the command
            AddMeasuredCourseToClubCommand command = AddMeasuredCourseToClubCommand.Create(Guid.Parse(golfClubIdClaim.Value), request.MeasuredCourseId, request);

            // Route the command
            await this.CommandRouter.Route(command, cancellationToken);

            // return the result
            return(this.NoContent());
        }
Esempio n. 10
0
        /// <summary>
        /// Converts from.
        /// </summary>
        /// <param name="viewModel">The view model.</param>
        /// <returns></returns>
        public AddMeasuredCourseToClubRequest ConvertFrom(MeasuredCourseViewModel viewModel)
        {
            AddMeasuredCourseToClubRequest request = new AddMeasuredCourseToClubRequest
            {
                MeasuredCourseId     = viewModel.MeasuredCourseId,
                StandardScratchScore = viewModel.StandardScratchScore,
                TeeColour            = viewModel.TeeColour,
                Name  = viewModel.Name,
                Holes = new List <HoleDataTransferObjectRequest>()
            };

            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 1,
                LengthInYards = viewModel.HoleNumber1Yards,
                Par           = viewModel.HoleNumber1Par,
                StrokeIndex   = viewModel.HoleNumber1StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 2,
                LengthInYards = viewModel.HoleNumber2Yards,
                Par           = viewModel.HoleNumber2Par,
                StrokeIndex   = viewModel.HoleNumber2StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 3,
                LengthInYards = viewModel.HoleNumber3Yards,
                Par           = viewModel.HoleNumber3Par,
                StrokeIndex   = viewModel.HoleNumber3StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 4,
                LengthInYards = viewModel.HoleNumber4Yards,
                Par           = viewModel.HoleNumber4Par,
                StrokeIndex   = viewModel.HoleNumber4StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 5,
                LengthInYards = viewModel.HoleNumber5Yards,
                Par           = viewModel.HoleNumber5Par,
                StrokeIndex   = viewModel.HoleNumber5StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 6,
                LengthInYards = viewModel.HoleNumber6Yards,
                Par           = viewModel.HoleNumber6Par,
                StrokeIndex   = viewModel.HoleNumber6StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 7,
                LengthInYards = viewModel.HoleNumber7Yards,
                Par           = viewModel.HoleNumber7Par,
                StrokeIndex   = viewModel.HoleNumber7StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 8,
                LengthInYards = viewModel.HoleNumber8Yards,
                Par           = viewModel.HoleNumber8Par,
                StrokeIndex   = viewModel.HoleNumber8StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 9,
                LengthInYards = viewModel.HoleNumber9Yards,
                Par           = viewModel.HoleNumber9Par,
                StrokeIndex   = viewModel.HoleNumber9StrokeIndex
            });

            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 10,
                LengthInYards = viewModel.HoleNumber10Yards,
                Par           = viewModel.HoleNumber10Par,
                StrokeIndex   = viewModel.HoleNumber10StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 11,
                LengthInYards = viewModel.HoleNumber11Yards,
                Par           = viewModel.HoleNumber11Par,
                StrokeIndex   = viewModel.HoleNumber11StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 12,
                LengthInYards = viewModel.HoleNumber12Yards,
                Par           = viewModel.HoleNumber12Par,
                StrokeIndex   = viewModel.HoleNumber12StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 13,
                LengthInYards = viewModel.HoleNumber13Yards,
                Par           = viewModel.HoleNumber13Par,
                StrokeIndex   = viewModel.HoleNumber13StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 14,
                LengthInYards = viewModel.HoleNumber14Yards,
                Par           = viewModel.HoleNumber14Par,
                StrokeIndex   = viewModel.HoleNumber14StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 15,
                LengthInYards = viewModel.HoleNumber15Yards,
                Par           = viewModel.HoleNumber15Par,
                StrokeIndex   = viewModel.HoleNumber15StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 16,
                LengthInYards = viewModel.HoleNumber16Yards,
                Par           = viewModel.HoleNumber16Par,
                StrokeIndex   = viewModel.HoleNumber16StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 17,
                LengthInYards = viewModel.HoleNumber17Yards,
                Par           = viewModel.HoleNumber17Par,
                StrokeIndex   = viewModel.HoleNumber17StrokeIndex
            });
            request.Holes.Add(new HoleDataTransferObjectRequest
            {
                HoleNumber    = 18,
                LengthInYards = viewModel.HoleNumber18Yards,
                Par           = viewModel.HoleNumber18Par,
                StrokeIndex   = viewModel.HoleNumber18StrokeIndex
            });

            return(request);
        }
 /// <summary>
 /// Creates this instance.
 /// </summary>
 /// <param name="golfClubId">The golf club identifier.</param>
 /// <param name="measuredCourseId">The measured course identifier.</param>
 /// <param name="addMeasuredCourseToClubRequest">The add measured course to club request.</param>
 /// <returns></returns>
 public static AddMeasuredCourseToClubCommand Create(Guid golfClubId, Guid measuredCourseId, AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest)
 {
     return(new AddMeasuredCourseToClubCommand(golfClubId, measuredCourseId, addMeasuredCourseToClubRequest, Guid.NewGuid()));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateGolfClubCommand" /> class.
 /// </summary>
 /// <param name="golfClubId">The golf club identifier.</param>
 /// <param name="measuredCourseId">The measured course identifier.</param>
 /// <param name="addMeasuredCourseToClubRequest">The add measured course to club request.</param>
 /// <param name="commandId">The command identifier.</param>
 private AddMeasuredCourseToClubCommand(Guid golfClubId, Guid measuredCourseId, AddMeasuredCourseToClubRequest addMeasuredCourseToClubRequest, Guid commandId) : base(commandId)
 {
     this.GolfClubId       = golfClubId;
     this.MeasuredCourseId = measuredCourseId;
     this.AddMeasuredCourseToClubRequest = addMeasuredCourseToClubRequest;
 }
        public void ModelFactory_ConvertFrom_MeasuredCourseViewModel_ConvertedSuccessfully()
        {
            ModelFactory factory = new ModelFactory();

            MeasuredCourseViewModel viewModel = ModelFactoryTestData.GetMeasuredCourseViewModel();

            AddMeasuredCourseToClubRequest request = factory.ConvertFrom(viewModel);

            request.Holes.Count.ShouldBe(18);
            request.Name.ShouldBe(viewModel.Name);
            request.StandardScratchScore.ShouldBe(viewModel.StandardScratchScore);
            request.TeeColour.ShouldBe(viewModel.TeeColour);

            request.Holes.Single(x => x.HoleNumber == 1).Par.ShouldBe(viewModel.HoleNumber1Par);
            request.Holes.Single(x => x.HoleNumber == 1).StrokeIndex.ShouldBe(viewModel.HoleNumber1StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 1).LengthInYards.ShouldBe(viewModel.HoleNumber1Yards);

            request.Holes.Single(x => x.HoleNumber == 2).Par.ShouldBe(viewModel.HoleNumber2Par);
            request.Holes.Single(x => x.HoleNumber == 2).StrokeIndex.ShouldBe(viewModel.HoleNumber2StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 2).LengthInYards.ShouldBe(viewModel.HoleNumber2Yards);

            request.Holes.Single(x => x.HoleNumber == 3).Par.ShouldBe(viewModel.HoleNumber3Par);
            request.Holes.Single(x => x.HoleNumber == 3).StrokeIndex.ShouldBe(viewModel.HoleNumber3StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 3).LengthInYards.ShouldBe(viewModel.HoleNumber3Yards);

            request.Holes.Single(x => x.HoleNumber == 4).Par.ShouldBe(viewModel.HoleNumber4Par);
            request.Holes.Single(x => x.HoleNumber == 4).StrokeIndex.ShouldBe(viewModel.HoleNumber4StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 4).LengthInYards.ShouldBe(viewModel.HoleNumber4Yards);

            request.Holes.Single(x => x.HoleNumber == 5).Par.ShouldBe(viewModel.HoleNumber5Par);
            request.Holes.Single(x => x.HoleNumber == 5).StrokeIndex.ShouldBe(viewModel.HoleNumber5StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 5).LengthInYards.ShouldBe(viewModel.HoleNumber5Yards);

            request.Holes.Single(x => x.HoleNumber == 6).Par.ShouldBe(viewModel.HoleNumber6Par);
            request.Holes.Single(x => x.HoleNumber == 6).StrokeIndex.ShouldBe(viewModel.HoleNumber6StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 6).LengthInYards.ShouldBe(viewModel.HoleNumber6Yards);

            request.Holes.Single(x => x.HoleNumber == 7).Par.ShouldBe(viewModel.HoleNumber7Par);
            request.Holes.Single(x => x.HoleNumber == 7).StrokeIndex.ShouldBe(viewModel.HoleNumber7StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 7).LengthInYards.ShouldBe(viewModel.HoleNumber7Yards);

            request.Holes.Single(x => x.HoleNumber == 8).Par.ShouldBe(viewModel.HoleNumber8Par);
            request.Holes.Single(x => x.HoleNumber == 8).StrokeIndex.ShouldBe(viewModel.HoleNumber8StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 8).LengthInYards.ShouldBe(viewModel.HoleNumber8Yards);

            request.Holes.Single(x => x.HoleNumber == 9).Par.ShouldBe(viewModel.HoleNumber9Par);
            request.Holes.Single(x => x.HoleNumber == 9).StrokeIndex.ShouldBe(viewModel.HoleNumber9StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 9).LengthInYards.ShouldBe(viewModel.HoleNumber9Yards);

            request.Holes.Single(x => x.HoleNumber == 10).Par.ShouldBe(viewModel.HoleNumber10Par);
            request.Holes.Single(x => x.HoleNumber == 10).StrokeIndex.ShouldBe(viewModel.HoleNumber10StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 10).LengthInYards.ShouldBe(viewModel.HoleNumber10Yards);

            request.Holes.Single(x => x.HoleNumber == 11).Par.ShouldBe(viewModel.HoleNumber11Par);
            request.Holes.Single(x => x.HoleNumber == 11).StrokeIndex.ShouldBe(viewModel.HoleNumber11StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 11).LengthInYards.ShouldBe(viewModel.HoleNumber11Yards);

            request.Holes.Single(x => x.HoleNumber == 12).Par.ShouldBe(viewModel.HoleNumber12Par);
            request.Holes.Single(x => x.HoleNumber == 12).StrokeIndex.ShouldBe(viewModel.HoleNumber12StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 12).LengthInYards.ShouldBe(viewModel.HoleNumber12Yards);

            request.Holes.Single(x => x.HoleNumber == 13).Par.ShouldBe(viewModel.HoleNumber13Par);
            request.Holes.Single(x => x.HoleNumber == 13).StrokeIndex.ShouldBe(viewModel.HoleNumber13StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 13).LengthInYards.ShouldBe(viewModel.HoleNumber13Yards);

            request.Holes.Single(x => x.HoleNumber == 14).Par.ShouldBe(viewModel.HoleNumber14Par);
            request.Holes.Single(x => x.HoleNumber == 14).StrokeIndex.ShouldBe(viewModel.HoleNumber14StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 14).LengthInYards.ShouldBe(viewModel.HoleNumber14Yards);

            request.Holes.Single(x => x.HoleNumber == 15).Par.ShouldBe(viewModel.HoleNumber15Par);
            request.Holes.Single(x => x.HoleNumber == 15).StrokeIndex.ShouldBe(viewModel.HoleNumber15StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 15).LengthInYards.ShouldBe(viewModel.HoleNumber15Yards);

            request.Holes.Single(x => x.HoleNumber == 16).Par.ShouldBe(viewModel.HoleNumber16Par);
            request.Holes.Single(x => x.HoleNumber == 16).StrokeIndex.ShouldBe(viewModel.HoleNumber16StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 16).LengthInYards.ShouldBe(viewModel.HoleNumber16Yards);

            request.Holes.Single(x => x.HoleNumber == 17).Par.ShouldBe(viewModel.HoleNumber17Par);
            request.Holes.Single(x => x.HoleNumber == 17).StrokeIndex.ShouldBe(viewModel.HoleNumber17StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 17).LengthInYards.ShouldBe(viewModel.HoleNumber17Yards);

            request.Holes.Single(x => x.HoleNumber == 18).Par.ShouldBe(viewModel.HoleNumber18Par);
            request.Holes.Single(x => x.HoleNumber == 18).StrokeIndex.ShouldBe(viewModel.HoleNumber18StrokeIndex);
            request.Holes.Single(x => x.HoleNumber == 18).LengthInYards.ShouldBe(viewModel.HoleNumber18Yards);
        }