예제 #1
0
 private static void CompleteOutcomeSimulation(int totalWeight, int usedWeight, List <int> results)
 {
     //the order of these do matter.
     WeightedNamedOutcome.Outcomes = Uncategorized.AddNothingOutcome(WeightedNamedOutcome.Outcomes, totalWeight, usedWeight);
     WeightedNamedOutcome.Outcomes = ResultAndOutcomeMerger.AssignNumberRangeToOutcomes(WeightedNamedOutcome.Outcomes);
     WeightedNamedOutcome.Outcomes = ResultAndOutcomeMerger.AssignResultsToOutcomes(results, WeightedNamedOutcome.Outcomes);
     WeightedNamedOutcome.Outcomes = Uncategorized.SetMultipleChanceToOccur(WeightedNamedOutcome.Outcomes, totalWeight);
 }
예제 #2
0
        public void Assert_that_occurances_are_correct()
        {
            BindingList <WeightedNamedOutcome> outcomeResults = ResultAndOutcomeMerger.AssignResultsToOutcomes(results, outcomes);

            int[] expected = new int[outcomeResults.Count];
            int[] result   = new int[outcomeResults.Count];

            for (int i = 0; i < expected.Length; i++)
            {
                expected[i] = 2;
            }

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = outcomeResults[i].Occurances;
                Console.WriteLine(outcomeResults[i].ToString() + " | occurances:" + outcomeResults[i].Occurances);
            }

            CollectionAssert.AreEqual(expected, result);
        }