refactor: Removing unused code

This commit is contained in:
Chris Cameron
2018-07-31 14:41:29 -04:00
parent 1353468da6
commit 03893c2669
2 changed files with 2 additions and 34 deletions

View File

@@ -36,18 +36,10 @@ namespace ICD.Common.Utils.Tests
Assert.AreEqual(100, MathUtils.MapRange(0, 10, 0, 100, 10));
}
[UsedImplicitly]
[TestCase(-10000, 5)]
[TestCase(10000, 5)]
public void GetNumberOfDigitsTest(int number, int expected)
{
Assert.AreEqual(expected, MathUtils.GetNumberOfDigits(number));
}
[Test, UsedImplicitly]
public void GetRangesTest()
{
IEnumerable<int> values = new int[] { 1, 3, 5, 6, 7, 8, 9, 10, 12 };
IEnumerable<int> values = new [] { 1, 3, 5, 6, 7, 8, 9, 10, 12 };
int[][] ranges = MathUtils.GetRanges(values).ToArray();
Assert.AreEqual(4, ranges.Length);
@@ -68,7 +60,7 @@ namespace ICD.Common.Utils.Tests
[Test, UsedImplicitly]
public void RoundToNearestTest()
{
IEnumerable<int> values = new int[] { 0, 15, 30, 45 };
IEnumerable<int> values = new [] { 0, 15, 30, 45 };
Assert.AreEqual(15, MathUtils.RoundToNearest(21, values));
}
}

View File

@@ -137,30 +137,6 @@ namespace ICD.Common.Utils
0.0f, 1.0f, new TimeSpan(value.Ticks).TotalSeconds);
}
/// <summary>
/// Gets the digit count for the given number.
/// </summary>
/// <param name="number"></param>
/// <returns></returns>
public static int GetNumberOfDigits(int number)
{
int output = number.ToString().Length;
if (number < 0)
output--;
return output;
}
/// <summary>
/// Gets the digit count for the given number.
/// </summary>
/// <param name="number"></param>
/// <returns></returns>
public static int GetNumberOfDigits(uint number)
{
return number.ToString().Length;
}
/// <summary>
/// Takes a sequence of numbers:
/// 1, 3, 5, 6, 7, 8, 9, 10, 12