public void Test_BTKtotalLessThan1() { Weapon betelgeuse = CreateMockBetelgeuse(); Weapon magShot = CreateMockMagshot(); Target target = CreateMockStandardTarget(); double pTotal = 0; double[] BG_TTK = BTKDistribution.DistributionOfBulletsToKill(betelgeuse, target, probabilities); for (int i = 0; i < BG_TTK.Length; ++i) { pTotal += BG_TTK[i]; } Assert.LessOrEqual(pTotal, 1); Assert.GreaterOrEqual(pTotal, 0.9); pTotal = 0; double[] MagShot_TTK = BTKDistribution.DistributionOfBulletsToKill(magShot, target, probabilities); for (int i = 0; i < MagShot_TTK.Length; ++i) { pTotal += MagShot_TTK[i]; } Assert.LessOrEqual(pTotal, 1); Assert.GreaterOrEqual(pTotal, 0.2); }
public void Test_PerfectV10GetsInstagib() { Weapon V10 = CreateMockV10(); Target target = CreateMockStandardTarget(); double[] V10_TTK = BTKDistribution.DistributionOfBulletsToKill(V10, target, new double[] { 0, 1 }); Assert.AreEqual(1, V10_TTK[1]); }
public void Test_BTKdist() { Weapon betelgeuse = CreateMockBetelgeuse(); Weapon magShot = CreateMockMagshot(); Target target = CreateMockStandardTarget(); Assert.AreEqual(0, BTKDistribution.DistributionOfBulletsToKill(betelgeuse, target, probabilities)[3]); Assert.LessOrEqual(0, BTKDistribution.DistributionOfBulletsToKill(betelgeuse, target, probabilities)[4]); Assert.AreEqual(0, BTKDistribution.DistributionOfBulletsToKill(magShot, target, probabilities)[2]); Assert.LessOrEqual(0, BTKDistribution.DistributionOfBulletsToKill(magShot, target, probabilities)[3]); }
public void Test_BTKprobabilitiesPositiveAndLessThanOne() { Weapon betelgeuse = CreateMockBetelgeuse(); Weapon magShot = CreateMockMagshot(); Target target = CreateMockStandardTarget(); double[] distBetelgeuse = BTKDistribution.DistributionOfBulletsToKill(betelgeuse, target, probabilities); foreach (double ProbabilityOfNumberOfShots in distBetelgeuse) { Assert.GreaterOrEqual(ProbabilityOfNumberOfShots, 0); Assert.LessOrEqual(ProbabilityOfNumberOfShots, 1); } double[] distBetelgeuseFullHS = BTKDistribution.DistributionOfBulletsToKill(betelgeuse, target, new double[] { 0, 1 }); foreach (double ProbabilityOfNumberOfShots in distBetelgeuseFullHS) { Assert.LessOrEqual(0, ProbabilityOfNumberOfShots); Assert.GreaterOrEqual(1, ProbabilityOfNumberOfShots); } }