Implementing stub tests

This commit is contained in:
Chris Cameron
2017-08-11 11:55:22 -04:00
parent be7126cb09
commit cde619bc31
2 changed files with 15 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ using ICD.Common.Utils.Extensions;
using NUnit.Framework; using NUnit.Framework;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System;
namespace ICD.Common.Utils.Tests.Extensions namespace ICD.Common.Utils.Tests.Extensions
{ {
@@ -323,13 +324,22 @@ namespace ICD.Common.Utils.Tests.Extensions
[Test] [Test]
public void MinByTest() public void MinByTest()
{ {
Assert.Inconclusive(); Assert.AreEqual(1, (new int[] { 3, 6, 2, 7, 1 }).MinBy(i => i));
} }
[Test] [Test]
public void MinByComparerTest() public void MinByComparerTest()
{ {
Assert.Inconclusive(); IComparer<int> comparer = new NegativeComparer();
Assert.AreEqual(7, (new int[] { 3, 6, 2, 7, 1 }).MinBy(i => i, comparer));
}
private class NegativeComparer : IComparer<int>
{
public int Compare(int x, int y)
{
return Comparer<int>.Default.Compare(-x, -y);
}
} }
[Test] [Test]

View File

@@ -10,7 +10,9 @@ namespace ICD.Common.Utils.Tests.Extensions
[Test] [Test]
public void IndexOfTest() public void IndexOfTest()
{ {
Assert.Inconclusive(); string first;
Assert.AreEqual(5, "test1test3test2".IndexOf(new string[] { "test2", "test3" }, out first));
Assert.AreEqual("test3", first);
} }
[TestCase(true, "12345", '1')] [TestCase(true, "12345", '1')]