public void ShouldOrderRecommendationsBasedOnSimilarityScore()
 {
     currentUser = ReviewerBuilder.BuildReviewerThatNeedsRecommendations();
     reviewers = new List<Reviewer> {ReviewerBuilder.BuildMyReviews()};
     var r = new RecommendItems(currentUser, reviewers).Calculate();
     Assert.AreEqual("Refactoring", r.First());
 }
Пример #2
0
 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());
 }
Пример #3
0
 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);
 }
Пример #6
0
 private double CalculateSimilarityScore(Reviewer reviewer)
 {
     return new PearsonCorrelation(CurrentUser, reviewer).Score();
 }
Пример #7
0
 public RankReviewers(Reviewer currentUser, List<Reviewer> reviewers)
 {
     CurrentUser = currentUser;
     Reviewers = reviewers;
 }
Пример #8
0
 public void SetUp()
 {
     reviewer = new Reviewer();
 }
 public EuclideanDistance(Reviewer r1, Reviewer r2)
 {
     R1 = r1;
     R2 = r2;
 }
Пример #10
0
 public RecommendItems(Reviewer currentUser, List<Reviewer> reviewers)
 {
     CurrentUser = currentUser;
     Reviewers = reviewers;
 }