Permalink
Browse files

Changed the names of a few of the steps algorithms to make them easie…

…r to read and add some consistency.
  • Loading branch information...
1 parent 195f3aa commit c065c75f7d05a7daefb6edf39fa25792ae156f77 @robertgreiner committed Nov 7, 2011
@@ -53,9 +53,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reviews\ReviewerTests.cs" />
<Compile Include="Steps\SumProductsTests.cs" />
- <Compile Include="Steps\SumSquaresOfSimilarScoresTests.cs" />
+ <Compile Include="Steps\SumSquaresTests.cs" />
<Compile Include="Steps\SumDifferenceSquaresTests.cs" />
- <Compile Include="Steps\SumSimilarScoresTests.cs" />
+ <Compile Include="Steps\SumScoresTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -11,7 +11,7 @@
namespace Recommender.Tests.Steps
{
[TestFixture]
- class SumSimilarScoresTests
+ class SumScoresTests
{
private Reviewer r1;
private Reviewer r2;
@@ -30,19 +30,19 @@ public void SumASingleScoreFromOneUser()
{
r1 = ReviewerBuilder.BuildOneReviewMax();
similarReviews = new List<string>(new String[] {"C# in Depth"});
- Assert.AreEqual(5.0, new SumSimilarScores(similarReviews, r1.Reviews).Calculate());
+ Assert.AreEqual(5.0, new SumScores(similarReviews, r1.Reviews).Calculate());
}
[Test]
public void ShouldSumAllOfTheScoresFromTheFirstUser()
{
- Assert.AreEqual(18.0, new SumSimilarScores(similarReviews, r1.Reviews).Calculate());
+ Assert.AreEqual(18.0, new SumScores(similarReviews, r1.Reviews).Calculate());
}
[Test]
public void ShouldSumAllOfTheScoresFromTheSecondUser()
{
- Assert.AreEqual(19.5, new SumSimilarScores(similarReviews, r2.Reviews).Calculate());
+ Assert.AreEqual(19.5, new SumScores(similarReviews, r2.Reviews).Calculate());
}
}
}
@@ -11,7 +11,7 @@
namespace Recommender.Tests.Steps
{
[TestFixture]
- class SumSquaresOfSimilarScoresTests
+ class SumSquaresTests
{
private Reviewer r1;
@@ -29,13 +29,13 @@ public void SetUp()
[Test]
public void ShouldSumTheSquaresOfAllOfTheScoresFromTheFirstUser()
{
- Assert.AreEqual(55.0, new SumSquaresOfSimilarScores(similarReviews, r1.Reviews).Calculate());
+ Assert.AreEqual(55.0, new SumSquares(similarReviews, r1.Reviews).Calculate());
}
[Test]
public void ShouldSumTheSquaresOfAllOfTheScoresFromTheSecondUser()
{
- Assert.AreEqual(69.75, new SumSquaresOfSimilarScores(similarReviews, r2.Reviews).Calculate());
+ Assert.AreEqual(69.75, new SumSquares(similarReviews, r2.Reviews).Calculate());
}
}
@@ -53,9 +53,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Steps\SimilarityScoreCommand.cs" />
<Compile Include="Steps\SumProducts.cs" />
- <Compile Include="Steps\SumSquaresOfSimilarScores.cs" />
+ <Compile Include="Steps\SumSquares.cs" />
<Compile Include="Steps\SumDifferenceSquares.cs" />
- <Compile Include="Steps\SumSimilarScores.cs" />
+ <Compile Include="Steps\SumScores.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -5,12 +5,12 @@
namespace Recommender.Steps
{
- public class SumSimilarScores : SimilarityScoreCommand
+ public class SumScores : SimilarityScoreCommand
{
private readonly List<string> SimilarReviews;
private readonly Dictionary<string, double> UserReviews;
- public SumSimilarScores(List<string> similarReviews, Dictionary<string, double> userReviews)
+ public SumScores(List<string> similarReviews, Dictionary<string, double> userReviews)
{
SimilarReviews = similarReviews;
UserReviews = userReviews;
@@ -5,12 +5,12 @@
namespace Recommender.Steps
{
- public class SumSquaresOfSimilarScores : SimilarityScoreCommand
+ public class SumSquares : SimilarityScoreCommand
{
private readonly List<string> SimilarReviews;
private readonly Dictionary<string, double> UserReviews;
- public SumSquaresOfSimilarScores(List<string> similarReviews, Dictionary<string, double> userReviews)
+ public SumSquares(List<string> similarReviews, Dictionary<string, double> userReviews)
{
SimilarReviews = similarReviews;
UserReviews = userReviews;

0 comments on commit c065c75

Please sign in to comment.