public void Then_Returns_Feedback_Of_Four_If_Between_Boundary(GetProvidersListItem source, string sectorSubjectArea)
        {
            source.EmployerFeedback.FeedbackRatings = new List <GetEmployerFeedbackRatingItem>
            {
                new GetEmployerFeedbackRatingItem
                {
                    FeedbackName  = "Good",
                    FeedbackCount = 4,
                },
                new GetEmployerFeedbackRatingItem
                {
                    FeedbackName  = "Excellent",
                    FeedbackCount = 2,
                }
            };

            source.ApprenticeFeedback.ProviderRating = new List <GetApprenticeFeedbackRatingItem>
            {
                new GetApprenticeFeedbackRatingItem
                {
                    Rating = "Good",
                    Count  = 1,
                },
                new GetApprenticeFeedbackRatingItem
                {
                    Rating = "Excellent",
                    Count  = 1,
                }
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 1, new List <DeliveryModeType>(), new List <FeedbackRatingType>(), new List <FeedbackRatingType>(), true);

            response.EmployerFeedback.TotalEmployerResponses.Should().Be(6);
            response.EmployerFeedback.TotalFeedbackRating.Should().Be(4);

            response.ApprenticeFeedback.TotalApprenticeResponses.Should().Be(2);
            response.ApprenticeFeedback.TotalFeedbackRating.Should().Be(4);
        }
        public void Then_If_There_Are_Multiple_Ratings_To_Filter_Then_Matches_On_Values(string sectorSubjectArea, GetProvidersListItem source)
        {
            source.FeedbackRatings = new List <GetFeedbackRatingItem>
            {
                new GetFeedbackRatingItem
                {
                    FeedbackName  = "Good",
                    FeedbackCount = 1,
                },
                new GetFeedbackRatingItem
                {
                    FeedbackName  = "Excellent",
                    FeedbackCount = 1,
                }
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 1, new List <DeliveryModeType>(), new List <FeedbackRatingType> {
                FeedbackRatingType.Poor, FeedbackRatingType.Excellent
            }, true);

            response.Should().NotBeNull();
            response.Should().BeEquivalentTo(source, options => options.ExcludingMissingMembers());
        }
Beispiel #3
0
        public void Then_If_Same_Feedback_Attribute_Score_And_Same_Responses_Then_The_Attribute_Is_Returned_In_Alphabetical_Order(GetProvidersListItem source, string sectorSubjectArea)
        {
            source.FeedbackAttributes = new List <GetFeedbackAttributeItem>
            {
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Sixth Attribute",
                    Strength      = 14,
                    Weakness      = 13
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Seventh Attribute",
                    Strength      = 15,
                    Weakness      = 14
                }
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 1, new List <DeliveryModeType>(), new List <FeedbackRatingType>(), true);

            response.Feedback.FeedbackAttributes.Strengths.Should().ContainInOrder(new List <string> {
                "Seventh Attribute"
            });
        }
Beispiel #4
0
 private static bool GetProvidersOverOneHundredMiles(GetTrainingCourseProviderListItem listItem)
 {
     return(listItem.DeliveryModes
            .Where(c => c.DeliveryModeType != DeliveryModeType.Workplace)
            .Any(deliveryType => deliveryType.DistanceInMiles >= 100));
 }
Beispiel #5
0
 private static bool GetProvidersWithinTenMilesWithScoreLessThanSix(GetTrainingCourseProviderListItem listItem)
 {
     return(listItem.Score < 6 &&
            GetDeliveryModeDistance(listItem.DeliveryModes) < 10);
 }
Beispiel #6
0
 private static bool GetProvidersWithinFiveToTenMilesWithScoreGreaterThanOrEqualToSix(GetTrainingCourseProviderListItem listItem)
 {
     return(listItem.Score >= 6 &&
            listItem.DeliveryModes
            .Where(c => c.DeliveryModeType != DeliveryModeType.Workplace)
            .Any(deliveryType =>
                 deliveryType.DistanceInMiles >= 5 &&
                 deliveryType.DistanceInMiles < 10));
 }
Beispiel #7
0
 private static bool GetProvidersUnderFiveMilesWithScoreGreaterThanOrEqualToSix(GetTrainingCourseProviderListItem listItem)
 {
     return(listItem.Score >= 6 &&
            GetDeliveryModeDistance(listItem.DeliveryModes) < 5);
 }
Beispiel #8
0
        public void Then_Returns_The_Top_Three_Feedback_Attribute_Strengths_And_Weaknesses(GetProvidersListItem source, string sectorSubjectArea)
        {
            source.FeedbackAttributes = new List <GetFeedbackAttributeItem>
            {
                new GetFeedbackAttributeItem
                {
                    AttributeName = "First Attribute",
                    Strength      = 11,
                    Weakness      = 10
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Second Attribute",
                    Strength      = 11,
                    Weakness      = 10
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Third Attribute",
                    Strength      = 13,
                    Weakness      = 10
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Fourth Attribute",
                    Strength      = 14,
                    Weakness      = 10
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Fifth Attribute",
                    Strength      = 11,
                    Weakness      = 11
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Sixth Attribute",
                    Strength      = 13,
                    Weakness      = 14
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Seventh Attribute",
                    Strength      = 14,
                    Weakness      = 15
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Eighth Attribute",
                    Strength      = 14,
                    Weakness      = 20
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Ninth Attribute",
                    Strength      = 140,
                    Weakness      = 144
                },
                new GetFeedbackAttributeItem
                {
                    AttributeName = "Tenth Attribute",
                    Strength      = 10,
                    Weakness      = 14
                }
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 1, new List <DeliveryModeType>(), new List <FeedbackRatingType>(), true);

            response.Feedback.FeedbackAttributes.Strengths.Should().ContainInOrder(new List <string> {
                "Fourth Attribute", "Third Attribute", "First Attribute"
            });
            response.Feedback.FeedbackAttributes.Weaknesses.Should().ContainInOrder(new List <string> {
                "Eighth Attribute", "Ninth Attribute", "Tenth Attribute"
            });
        }
        public void Then_Returns_All_Available_Apprentice_Feedback_Attribute_Agreess_And_Disagrees_Where_Agrees_Disagrees_Greater_Than_Zero(InnerApi.Responses.GetProvidersListItem source, string sectorSubjectArea)
        {
            source.ApprenticeFeedback.ProviderAttribute = new List <InnerApi.Responses.GetApprenticeFeedbackAttributeItem>
            {
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "First Attribute",
                    Category = "Category",
                    Agree    = 1,
                    Disagree = 1
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Second Attribute",
                    Category = "Category",
                    Agree    = 0,
                    Disagree = 0
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Third Attribute",
                    Category = "Category",
                    Agree    = 1,
                    Disagree = 1
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Fourth Attribute",
                    Category = "Category",
                    Agree    = 0,
                    Disagree = 0
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Fifth Attribute",
                    Category = "Category",
                    Agree    = 1,
                    Disagree = 1
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Sixth Attribute",
                    Category = "Category",
                    Agree    = 0,
                    Disagree = 0
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Seventh Attribute",
                    Category = "Category",
                    Agree    = 1,
                    Disagree = 1
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Eighth Attribute",
                    Category = "Category",
                    Agree    = 0,
                    Disagree = 0
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Ninth Attribute",
                    Category = "Category",
                    Agree    = 0,
                    Disagree = 0
                },
                new InnerApi.Responses.GetApprenticeFeedbackAttributeItem
                {
                    Name     = "Tenth Attribute",
                    Category = "Category",
                    Agree    = 1,
                    Disagree = 1
                }
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 1, new List <DeliveryModeType>(), new List <FeedbackRatingType>(), new List <FeedbackRatingType>(), true);

            response.ApprenticeFeedback.FeedbackAttributes.Select(x => x.Name)
            .Should().ContainInOrder(
                new List <string> {
                "First Attribute",
                "Third Attribute",
                "Fifth Attribute",
                "Seventh Attribute",
                "Tenth Attribute"
            });
        }
Beispiel #10
0
        public void Then_Returns_All_Available_Employer_Feedback_Attribute_Strengths_And_Weaknesses_Where_Strengths_Weaknesses_Greater_Than_Zero(InnerApi.Responses.GetProvidersListItem source, string sectorSubjectArea)
        {
            source.EmployerFeedback.FeedbackAttributes = new List <InnerApi.Responses.GetEmployerFeedbackAttributeItem>
            {
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "First Attribute",
                    Strength      = 1,
                    Weakness      = 1
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Second Attribute",
                    Strength      = 0,
                    Weakness      = 0
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Third Attribute",
                    Strength      = 1,
                    Weakness      = 1
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Fourth Attribute",
                    Strength      = 0,
                    Weakness      = 0
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Fifth Attribute",
                    Strength      = 1,
                    Weakness      = 1
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Sixth Attribute",
                    Strength      = 0,
                    Weakness      = 0
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Seventh Attribute",
                    Strength      = 1,
                    Weakness      = 1
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Eighth Attribute",
                    Strength      = 0,
                    Weakness      = 0
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Ninth Attribute",
                    Strength      = 0,
                    Weakness      = 0
                },
                new InnerApi.Responses.GetEmployerFeedbackAttributeItem
                {
                    AttributeName = "Tenth Attribute",
                    Strength      = 1,
                    Weakness      = 1
                }
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 1, new List <DeliveryModeType>(), new List <FeedbackRatingType>(), new List <FeedbackRatingType>(), true);

            response.EmployerFeedback.FeedbackAttributes.Select(x => x.AttributeName)
            .Should().ContainInOrder(
                new List <string> {
                "First Attribute",
                "Third Attribute",
                "Fifth Attribute",
                "Seventh Attribute",
                "Tenth Attribute"
            });
        }