public void IntervalArray_ClearTheArray_ShouldThrowNullReferenceException() { IntervalArray <int> array = new IntervalArray <int>(1, 5) { 1, 2, 3, 4 }; array.Clear(); Exception ex = Assert.Throws <NullReferenceException>(() => array[array.FirstIndex]); Assert.Equal("Object reference not set to an instance of an object.", ex.Message); }