示例#1
0
        //---------------------------------------------------------------------

        private void CheckRandomBetweenNotCalled(ushort expectedMapCode)
        {
            RandomBetweenShouldFail();

            ushort selectedMapCode = MajorityRule.SelectMapCode(codeCounts);

            Assert.AreEqual(expectedMapCode, selectedMapCode);
        }
示例#2
0
        public void TwoCodes()
        {
            codeCounts[77] = 5;
            codeCounts[11] = 4;
            const ushort expectedMapCode = 77;

            RandomBetweenShouldFail();

            ushort selectedMapCode = MajorityRule.SelectMapCode(codeCounts);

            Assert.AreEqual(expectedMapCode, selectedMapCode);
        }
示例#3
0
        //---------------------------------------------------------------------

        public void CheckMostCommonCodes(params ushort[] mostCommonCodes)
        {
            Assert.IsNotNull(mostCommonCodes);
            Assert.IsTrue(mostCommonCodes.Length > 0);

            List <ushort> selectedCodes = new List <ushort>();

            for (int i = 0; i < mostCommonCodes.Length; i++)
            {
                SetupRandomBetween(0, mostCommonCodes.Length - 1, i);
                selectedCodes.Add(MajorityRule.SelectMapCode(codeCounts));
            }
            Assert.That(selectedCodes, Is.EquivalentTo(mostCommonCodes));
        }
示例#4
0
 public void Count0()
 {
     ushort dummy = MajorityRule.SelectMapCode(codeCounts);
 }
示例#5
0
 public void NullArgument()
 {
     ushort dummy = MajorityRule.SelectMapCode(null);
 }