diff --git a/App/Program.cs b/App/Program.cs index bf2b69f..d7448d9 100644 --- a/App/Program.cs +++ b/App/Program.cs @@ -7,6 +7,7 @@ double idealOverround = 1.15; Console.WriteLine("ideal overround: {0}", idealOverround); +Console.WriteLine("ideal booksum: {0}", idealOverround * fairBooksum); IOverroundMethod[] methods = [new Multiplicative(), new Additive(), new Power(), new OddsRatio()]; foreach (var method in methods) @@ -14,5 +15,5 @@ double[] odds = method.Apply(fairPrices, idealOverround); Console.WriteLine(""); Console.WriteLine("method: {0}", method.GetType().Name); - Console.WriteLine("odds: [{0}]", string.Join(", ", odds)); + Console.WriteLine("odds: [{0}], booksum: {1}", string.Join(", ", odds), Booksum.FromPrices(odds)); } \ No newline at end of file diff --git a/Overround.Tests/AdditiveTest.cs b/Overround.Tests/AdditiveTest.cs index 159590a..336300b 100644 --- a/Overround.Tests/AdditiveTest.cs +++ b/Overround.Tests/AdditiveTest.cs @@ -14,6 +14,7 @@ public void TestApplyNoOverround() double[] fairPrices = [1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4], odds, Delta); } [TestMethod] @@ -42,5 +43,6 @@ public void TestApplyWithFairBooksumOf2() double[] fairPrices = [1 / 0.2, 1 / 0.4, 1 / 0.6, 1 / 0.8]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround * 2, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([3.636, 2.105, 1.481, 1.143], odds, Delta); } } \ No newline at end of file diff --git a/Overround.Tests/MultiplicativeTest.cs b/Overround.Tests/MultiplicativeTest.cs index 4792e7f..f9dbc24 100644 --- a/Overround.Tests/MultiplicativeTest.cs +++ b/Overround.Tests/MultiplicativeTest.cs @@ -14,6 +14,7 @@ public void TestApplyNoOverround() double[] fairPrices = [1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4], odds, Delta); } [TestMethod] @@ -42,5 +43,6 @@ public void TestApplyWithFairBooksumOf2() double[] fairPrices = [1 / 0.2, 1 / 0.4, 1 / 0.6, 1 / 0.8]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround * 2, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([4.348, 2.174, 1.449, 1.087], odds, Delta); } } \ No newline at end of file diff --git a/Overround.Tests/OddsRatioTest.cs b/Overround.Tests/OddsRatioTest.cs index 2c8f98b..d171438 100644 --- a/Overround.Tests/OddsRatioTest.cs +++ b/Overround.Tests/OddsRatioTest.cs @@ -14,6 +14,7 @@ public void TestApplyNoOverround() double[] fairPrices = [1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4], odds, Delta); } [TestMethod] @@ -42,5 +43,6 @@ public void TestApplyWithFairBooksumOf2() double[] fairPrices = [1 / 0.2, 1 / 0.4, 1 / 0.6, 1 / 0.8]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround * 2, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([3.744, 2.029, 1.457, 1.171], odds, Delta); } } \ No newline at end of file diff --git a/Overround.Tests/PowerTest.cs b/Overround.Tests/PowerTest.cs index b265648..72a0f1f 100644 --- a/Overround.Tests/PowerTest.cs +++ b/Overround.Tests/PowerTest.cs @@ -14,6 +14,7 @@ public void TestApplyNoOverround() double[] fairPrices = [1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4], odds, Delta); } [TestMethod] @@ -42,5 +43,6 @@ public void TestApplyWithFairBooksumOf2() double[] fairPrices = [1 / 0.2, 1 / 0.4, 1 / 0.6, 1 / 0.8]; double[] odds = method.Apply(fairPrices, idealOverround); Assert.AreEqual(idealOverround * 2, Booksum.FromPrices(odds), Delta); + ArrayAssert.AreEqual([3.458, 2.027, 1.483, 1.188], odds, Delta); } } \ No newline at end of file