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);
 }
Esempio n. 6
0
 private double CalculateSimilarityScore(Reviewer reviewer)
 {
     return new PearsonCorrelation(CurrentUser, reviewer).Score();
 }
Esempio n. 7
0
 public RankReviewers(Reviewer currentUser, List<Reviewer> reviewers)
 {
     CurrentUser = currentUser;
     Reviewers = reviewers;
 }
Esempio n. 8
0
 public void SetUp()
 {
     reviewer = new Reviewer();
 }
 public EuclideanDistance(Reviewer r1, Reviewer r2)
 {
     R1 = r1;
     R2 = r2;
 }
Esempio n. 10
0
 public RecommendItems(Reviewer currentUser, List<Reviewer> reviewers)
 {
     CurrentUser = currentUser;
     Reviewers = reviewers;
 }