mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
Implementing stub tests
This commit is contained in:
@@ -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]
|
||||||
|
|||||||
@@ -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')]
|
||||||
|
|||||||
Reference in New Issue
Block a user