//--------------------------------------------------------------------- private void CheckRandomBetweenNotCalled(ushort expectedMapCode) { RandomBetweenShouldFail(); ushort selectedMapCode = MajorityRule.SelectMapCode(codeCounts); Assert.AreEqual(expectedMapCode, selectedMapCode); }
public void TwoCodes() { codeCounts[77] = 5; codeCounts[11] = 4; const ushort expectedMapCode = 77; RandomBetweenShouldFail(); ushort selectedMapCode = MajorityRule.SelectMapCode(codeCounts); Assert.AreEqual(expectedMapCode, selectedMapCode); }
//--------------------------------------------------------------------- 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)); }
public void Count0() { ushort dummy = MajorityRule.SelectMapCode(codeCounts); }
public void NullArgument() { ushort dummy = MajorityRule.SelectMapCode(null); }