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;
 }