public void ShouldOrderRecommendationsBasedOnSimilarityScore() { currentUser = ReviewerBuilder.BuildReviewerThatNeedsRecommendations(); reviewers = new List<Reviewer> {ReviewerBuilder.BuildMyReviews()}; var r = new RecommendItems(currentUser, reviewers).Calculate(); Assert.AreEqual("Refactoring", r.First()); }
public void SumASingleScoreFromOneUser() { r1 = ReviewerBuilder.BuildOneReviewMax(); similarReviews = new List<string>(new String[] {"C# in Depth"}); Assert.AreEqual(5.0, new SumScores(similarReviews, r1.Reviews).Calculate()); }
public void SetUp() { r1 = ReviewerBuilder.BuildReviewer1(); r2 = ReviewerBuilder.BuildReviewer2(); similarReviews = new FindSimilarReviews(r1.Reviews, r2.Reviews).Calculate(); }
public void SetUp() { currentUser = ReviewerBuilder.BuildReviewerThatNeedsRecommendations(); reviewers = ReviewerBuilder.BuildReviewers(); }
public void ShouldNotMakeRecommendationsIfUsersHaveNoSimilarReviews() { currentUser = ReviewerBuilder.BuildAReviewerThatReviewedSomethingUnique(); var r = new RecommendItems(currentUser, reviewers).Calculate(); Assert.AreEqual(0, r.Count); }
private double CalculateSimilarityScore(Reviewer reviewer) { return new PearsonCorrelation(CurrentUser, reviewer).Score(); }
public RankReviewers(Reviewer currentUser, List<Reviewer> reviewers) { CurrentUser = currentUser; Reviewers = reviewers; }
public void SetUp() { reviewer = new Reviewer(); }
public EuclideanDistance(Reviewer r1, Reviewer r2) { R1 = r1; R2 = r2; }
public RecommendItems(Reviewer currentUser, List<Reviewer> reviewers) { CurrentUser = currentUser; Reviewers = reviewers; }