public void Conservative_Rating_Equation_Outputs_Expected(double mean, double sd, double conservativeMultiplier) { // Copied from TrueSkillEngine.GetConservativeRating() var expectedConservativeRating = mean - conservativeMultiplier * sd; var trueSkillEngine = new TwoPlayerTrueSkillEngine(initialMean: mean, initialStandardDeviation: sd, conservativeRatingMultiplier: conservativeMultiplier); trueSkillEngine.GetConservativeRating(trueSkillEngine.GetDefaultRating()).Should().Be(expectedConservativeRating, "The conservative rating is calculated using the given formula, so it should match when using the given values."); }
public void Default_Rating_Should_Have_Expected_Default_Values(double initialMean, double initialSd, double conservativeMultiplier) { // Arrange var trueSkillEngine = new TwoPlayerTrueSkillEngine(initialMean, initialSd, conservativeMultiplier); // Act var rating = trueSkillEngine.GetDefaultRating(); // Assert rating.StandardDeviation.Should().Be(initialSd, "The default rating should have the given initial standard deviation"); rating.Mean.Should().Be(initialMean, "The default rating should have the given initial mean"); }