private Dictionary <Int64, Int64> GetAllRanges(LongIntegerStatusStorer inputStorer) { Dictionary <Int64, Int64> returnDictionary = new Dictionary <Int64, Int64>(); Action <Int64, Int64> storeInDictionaryAction = (startValue, length) => { returnDictionary.Add(startValue, length); }; inputStorer.TraverseTree(storeInDictionaryAction); return(returnDictionary); }
public void GetAllRangesDescending_TreeIsEmpty() { IEnumerable <LongIntegerRange> result = testLongIntegerStatusStorer.GetAllRangesDescending(); Assert.AreEqual(0, result.Count()); testLongIntegerStatusStorer = new LongIntegerStatusStorer(); testLongIntegerStatusStorer.SetStatusTrue(5); testLongIntegerStatusStorer.SetStatusFalse(5); result = testLongIntegerStatusStorer.GetAllRangesDescending(); Assert.AreEqual(0, result.Count()); }
public void MaximumRange_TreeIsEmpty() { InvalidOperationException e = Assert.Throws <InvalidOperationException>(delegate { LongIntegerRange result = testLongIntegerStatusStorer.MaximumRange; }); Assert.That(e.Message, NUnit.Framework.Does.StartWith("The underlying tree is empty.")); testLongIntegerStatusStorer = new LongIntegerStatusStorer(); testLongIntegerStatusStorer.SetStatusTrue(5); testLongIntegerStatusStorer.SetStatusFalse(5); e = Assert.Throws <InvalidOperationException>(delegate { LongIntegerRange result = testLongIntegerStatusStorer.MaximumRange; }); Assert.That(e.Message, NUnit.Framework.Does.StartWith("The underlying tree is empty.")); }
protected void SetUp() { testLongIntegerStatusStorer = new LongIntegerStatusStorer(); }