mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
Implementing stub tests
This commit is contained in:
parent
be7126cb09
commit
cde619bc31
2 changed files with 15 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ using ICD.Common.Utils.Extensions;
|
|||
using NUnit.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System;
|
||||
|
||||
namespace ICD.Common.Utils.Tests.Extensions
|
||||
{
|
||||
|
|
@ -323,13 +324,22 @@ namespace ICD.Common.Utils.Tests.Extensions
|
|||
[Test]
|
||||
public void MinByTest()
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
Assert.AreEqual(1, (new int[] { 3, 6, 2, 7, 1 }).MinBy(i => i));
|
||||
}
|
||||
|
||||
[Test]
|
||||
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]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ namespace ICD.Common.Utils.Tests.Extensions
|
|||
[Test]
|
||||
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')]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue