Ejemplo n.º 1
0
        public void ProvVsProv()
        {
            int v_ActualScore = (int)EloCalculator.CalcProvisionalVsProvisionalRanking(1500, 1, 1500, EloCalculator.ModifierProvisional[EloCalculator.Modifier.Win]);

            Assert.AreEqual(1550, v_ActualScore);
            v_ActualScore = (int)EloCalculator.CalcProvisionalVsProvisionalRanking(1700, 6, 1100, EloCalculator.ModifierProvisional[EloCalculator.Modifier.Win]);
            Assert.AreEqual(1671, v_ActualScore);
            v_ActualScore = (int)EloCalculator.CalcProvisionalVsProvisionalRanking(1158, 12, 1541, EloCalculator.ModifierProvisional[EloCalculator.Modifier.Win]);
            Assert.AreEqual(1180, v_ActualScore);

            v_ActualScore = (int)EloCalculator.CalcProvisionalVsProvisionalRanking(1500, 1, 1500, EloCalculator.ModifierProvisional[EloCalculator.Modifier.Lose]);
            Assert.AreEqual(1450, v_ActualScore);

            v_ActualScore = (int)EloCalculator.CalcProvisionalVsProvisionalRanking(1500, 1, 1500, EloCalculator.ModifierProvisional[EloCalculator.Modifier.Stalemate]);
            Assert.AreEqual(1500, v_ActualScore);

            Assert.Throws <ArgumentException>(() => EloCalculator.CalcProvisionalVsProvisionalRanking(1500, -1, 1500, EloCalculator.ModifierProvisional[EloCalculator.Modifier.Win]));
            Assert.Throws <ArgumentException>(() => EloCalculator.CalcProvisionalVsProvisionalRanking(1500, 21, 1500, EloCalculator.ModifierProvisional[EloCalculator.Modifier.Win]));
        }