public void TestGetSorted() { AddFloats(); var sortedList = enhancedArrayList.GetSorted(); enhancedArrayList.Sort(); CollectionAssert.AreEqual(enhancedArrayList, sortedList); }
/// <summary> /// Gets the median value of the elements in the MedianSlider. /// </summary> /// /// <returns> /// The median value of the elements in the MedianSlider, /// if the number of elements in the MedianSlider is equal to the slider size. /// Otherwise,the last element in the MedianSlider. /// </returns> public float GetMedianValue() { if (!SliderFilled) { return((float)slider.GetLast()); } var sortedSlider = slider.GetSorted(); return((float)sortedSlider[medianIndex]); }