public void PullTests() { DepletableBag <int> bag = new DepletableBag <int>(sampleList); Dictionary <int, bool> dictionary = new Dictionary <int, bool>(); for (int i = 0; i < sampleList.Count; ++i) { dictionary.Add(i, false); } while (bag.Count > 0) { dictionary[bag.PopNext()] = true; } for (int i = 0; i < sampleList.Count; ++i) { Assert.IsTrue(dictionary[i + 1]); } for (int i = 0; i < 100; ++i) { if (i >= sampleList.Count) { Assert.AreEqual(default(int), bag.PopNext()); } } }
protected override void FinishInitialization() { currentStimSet = stepBag.PopNext(); for (int parameter = 0; parameter < 4; parameter++) { SetStepValue(parameter, currentStimSet[parameter]); } }
public void PsEmptyTests() { DepletableBag <int> bag = new DepletableBag <int>(sampleList); Assert.IsFalse(bag.Count <= 0); for (int i = 0; i < sampleList.Count - 1; ++i) { bag.PopNext(); Assert.IsFalse(bag.Count <= 0); } bag.PopNext(); Assert.IsTrue(bag.Count <= 0); }
public void PullAutoResetTests() { DepletableBag <int> bag = new DepletableBag <int>(sampleList); bag.AutoRefill = true; for (int i = 0; i < 100; ++i) { Assert.AreNotEqual(default(int), bag.PopNext()); } }
public string GetNextImageURL() => imageURLs.PopNext();