public void TestForce() { var itemSelector = new RouletteWheel(); var allState = new AllocationState(10, 15, new Single[] { 1.5F, 2.5F, 3.5F, 4.5F, 5.5F }, itemSelector); allState.Reset(); allState.Force(2); Assert.That(allState.Processed, Is.True); Assert.That(allState.Forced, Is.True); Assert.That(allState.ChosenItem, Is.EqualTo(2)); }
public void TestForceAndResetForced() { var itemSelector = new RouletteWheel(); var allState = new AllocationState(10, 15, new Single[] { 1.5F, 2.5F, 3.5F, 4.5F, 5.5F }, itemSelector); allState.Reset(); allState.Force(2); //Overwrites currentaptitudes for (int i = 0; i < allState.InitialAptitudes.Length; i++) { allState.CurrentAptitudes[i] = 0; } allState.Reset(); Assert.That(allState.Processed, Is.False); Assert.That(allState.Forced, Is.False); Assert.That(allState.ChosenItem, Is.Null); }