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.")); }
public void SetStatusTrue_MergedRangeTotalExceedsInt64MaxValue() { testLongIntegerStatusStorer.SetRangeTrue(0, 9223372036854775805); testLongIntegerStatusStorer.SetStatusTrue(9223372036854775807); InvalidOperationException e = Assert.Throws <InvalidOperationException>(delegate { testLongIntegerStatusStorer.SetStatusTrue(9223372036854775806); }); Assert.That(e.Message, NUnit.Framework.Does.StartWith("The class cannot support storing statuses for greater than Int64.MaxValue integers.")); }