public void TestGetScoreNoRatings() { var broadcast = new MockBroadcast(0); var score = broadcast.GetScore(); Assert.AreEqual(0D, score, Delta); }
public void TestGetScoreWithRatings([Values(0, 5, 10)] int positiveWeight, [Values(0, 5, 10)] int negativeWeight) { var positiveRating = new MockRating(RatingPolarity.Positive, positiveWeight); var negativeRating = new MockRating(RatingPolarity.Negative, negativeWeight); var broadcast = new MockBroadcast(positiveRating, negativeRating); var score = broadcast.GetScore(); var weightSum = positiveWeight + negativeWeight; var expected = weightSum > 0 ? (double)positiveWeight / weightSum : 0D; Assert.AreEqual(expected, score, Delta); }