diff --git a/ICD.Common.Utils.Tests/Extensions/ListExtensionsTest.cs b/ICD.Common.Utils.Tests/Extensions/ListExtensionsTest.cs index 31644df..b96facc 100644 --- a/ICD.Common.Utils.Tests/Extensions/ListExtensionsTest.cs +++ b/ICD.Common.Utils.Tests/Extensions/ListExtensionsTest.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using ICD.Common.Utils.Extensions; using NUnit.Framework; @@ -43,82 +42,6 @@ namespace ICD.Common.Utils.Tests.Extensions Assert.AreEqual(1, testList[3]); } - [Test] - public void PadRightTest() - { - List testList = new List(); - testList.PadRight(10); - - Assert.AreEqual(10, testList.Count); - Assert.AreEqual(0, testList.Sum()); - - testList = new List - { - 1, - 2, - 3, - 4, - 5 - }; - - testList.PadRight(10); - - Assert.AreEqual(10, testList.Count); - Assert.AreEqual(15, testList.Sum()); - - testList = new List - { - 1, - 2, - 3, - 4, - 5 - }; - - testList.PadRight(1); - - Assert.AreEqual(5, testList.Count); - Assert.AreEqual(15, testList.Sum()); - } - - [Test] - public void PadRightDefaultTest() - { - List testList = new List(); - testList.PadRight(10, 1); - - Assert.AreEqual(10, testList.Count); - Assert.AreEqual(10, testList.Sum()); - - testList = new List - { - 1, - 2, - 3, - 4, - 5 - }; - - testList.PadRight(10, 1); - - Assert.AreEqual(10, testList.Count); - Assert.AreEqual(20, testList.Sum()); - - testList = new List - { - 1, - 2, - 3, - 4, - 5 - }; - - testList.PadRight(1, 1); - - Assert.AreEqual(5, testList.Count); - Assert.AreEqual(15, testList.Sum()); - } - private sealed class InverseComparer : IComparer { public int Compare(int x, int y) diff --git a/ICD.Common.Utils/Extensions/ListExtensions.cs b/ICD.Common.Utils/Extensions/ListExtensions.cs index b7d8298..e6e37a3 100644 --- a/ICD.Common.Utils/Extensions/ListExtensions.cs +++ b/ICD.Common.Utils/Extensions/ListExtensions.cs @@ -135,45 +135,6 @@ namespace ICD.Common.Utils.Extensions return extends.AddSorted(item, comparer); } - /// - /// Pads the list to the given total length. - /// - /// - /// - /// - [PublicAPI] - public static void PadRight(this IList extends, int totalLength) - { - if (extends == null) - throw new ArgumentNullException("extends"); - - if (totalLength < 0) - throw new ArgumentOutOfRangeException("totalLength", "totalLength must be greater or equal to 0"); - - extends.PadRight(totalLength, default(T)); - } - - /// - /// Pads the list to the given total length with the given item. - /// - /// - /// - /// - /// - [PublicAPI] - public static void PadRight(this IList extends, int totalLength, T item) - { - if (extends == null) - throw new ArgumentNullException("extends"); - - if (totalLength < 0) - throw new ArgumentOutOfRangeException("totalLength", "totalLength must be greater or equal to 0"); - - int pad = totalLength - extends.Count; - for (int index = 0; index < pad; index++) - extends.Add(item); - } - /// /// Returns the index of the item in the list. ///