diff --git a/GlickoTest/GlickoTest.vb b/GlickoTest/GlickoTest.vb new file mode 100755 index 0000000..a9be1d6 --- /dev/null +++ b/GlickoTest/GlickoTest.vb @@ -0,0 +1,74 @@ +Imports System.Xml.Linq + +Imports Microsoft.VisualStudio.TestTools.UnitTesting + +Imports System.Text +Imports PepperBet + + +Public Class GlickoTest + + Private testContextInstance As TestContext + + ''' + '''Gets or sets the test context which provides + '''information about and functionality for the current test run. + ''' + Public Property TestContext() As TestContext + Get + Return testContextInstance + End Get + Set(ByVal value As TestContext) + testContextInstance = value + End Set + End Property + +#Region "Additional test attributes" + ' + ' You can use the following additional attributes as you write your tests: + ' + ' Use ClassInitialize to run code before running the first test in the class + ' Public Shared Sub MyClassInitialize(ByVal testContext As TestContext) + ' End Sub + ' + ' Use ClassCleanup to run code after all tests in a class have run + ' Public Shared Sub MyClassCleanup() + ' End Sub + ' + ' Use TestInitialize to run code before running each test + ' Public Sub MyTestInitialize() + ' End Sub + ' + ' Use TestCleanup to run code after each test has run + ' Public Sub MyTestCleanup() + ' End Sub + ' +#End Region + + + + Public Sub TestGlickoMatchup() + Dim testman As New Glicko("testman", 0) + testman.K = 1500 + testman.RD = 200 + Dim opp1 As New Glicko("1", 0) + opp1.K = 1400 + opp1.RD = 30 + Dim opp2 As New Glicko("2", 0) + opp2.K = 1550 + opp2.RD = 100 + Dim opp3 As New Glicko("3", 0) + opp3.K = 1700 + opp3.RD = 300 + + 'testman.Update({opp1, opp2, opp3}, {1, 0, 0}, 0) + Glicko.UpdateBatch(testman, opp1, 1, 0, 0) + Glicko.UpdateBatch(testman, opp2, 0, 1, 0) + Glicko.UpdateBatch(testman, opp3, 0, 1, 0) + 'testmans K should be 1464 and RD should be 151.4 + + Assert.AreEqual(testman.K, 1464.2190389663426) + Assert.AreEqual(testman.RD, 151.2537434317843) + End Sub + +End Class diff --git a/GlickoTest/GlickoTest.vbproj b/GlickoTest/GlickoTest.vbproj new file mode 100755 index 0000000..f9fb76e --- /dev/null +++ b/GlickoTest/GlickoTest.vbproj @@ -0,0 +1,98 @@ + + + + Debug + AnyCPU + + + + + {E6794089-F810-402B-A3CE-0D7EA579108A} + Library + GlickoTest + GlickoTest + 512 + Windows + v4.0 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + $(DevEnvDir)PublicAssemblies\ + + + true + full + true + true + bin\Debug\ + GlickoTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + GlickoTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + {F88AA82A-320E-4A3B-87A3-C07BFC6F3450} + PepperBet + + + + + \ No newline at end of file diff --git a/GlickoTest/My Project/AssemblyInfo.vb b/GlickoTest/My Project/AssemblyInfo.vb new file mode 100755 index 0000000..16d431c --- /dev/null +++ b/GlickoTest/My Project/AssemblyInfo.vb @@ -0,0 +1,37 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/PepperBet.sln b/PepperBet.sln index d5a03e5..e7a1b63 100755 --- a/PepperBet.sln +++ b/PepperBet.sln @@ -5,7 +5,14 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PepperBet", "PepperBet\Pepp EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AutoUpdater", "AutoUpdater\AutoUpdater.vbproj", "{1E99431F-65AD-4CFD-9A8A-264CED54DAEB}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GlickoTest", "GlickoTest\GlickoTest.vbproj", "{E6794089-F810-402B-A3CE-0D7EA579108A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F59519B4-43BD-4F38-A7AB-8694B5014CB2}" +EndProject Global + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = PepperBet.vsmdi + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 @@ -29,6 +36,12 @@ Global {1E99431F-65AD-4CFD-9A8A-264CED54DAEB}.Release|Any CPU.Build.0 = Release|Any CPU {1E99431F-65AD-4CFD-9A8A-264CED54DAEB}.Release|x86.ActiveCfg = Release|x86 {1E99431F-65AD-4CFD-9A8A-264CED54DAEB}.Release|x86.Build.0 = Release|x86 + {E6794089-F810-402B-A3CE-0D7EA579108A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6794089-F810-402B-A3CE-0D7EA579108A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6794089-F810-402B-A3CE-0D7EA579108A}.Debug|x86.ActiveCfg = Debug|Any CPU + {E6794089-F810-402B-A3CE-0D7EA579108A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6794089-F810-402B-A3CE-0D7EA579108A}.Release|Any CPU.Build.0 = Release|Any CPU + {E6794089-F810-402B-A3CE-0D7EA579108A}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE