コード例 #1
0
 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();
 }
コード例 #4
0
 public void SetUp()
 {
     currentUser = ReviewerBuilder.BuildReviewerThatNeedsRecommendations();
     reviewers = ReviewerBuilder.BuildReviewers();
 }
コード例 #5
0
 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();
 }
コード例 #9
0
 public EuclideanDistance(Reviewer r1, Reviewer r2)
 {
     R1 = r1;
     R2 = r2;
 }
コード例 #10
0
 public RecommendItems(Reviewer currentUser, List<Reviewer> reviewers)
 {
     CurrentUser = currentUser;
     Reviewers = reviewers;
 }