Additional unit tests and test stubs

This commit is contained in:
Chris Cameron
2017-10-13 16:50:48 -04:00
parent 561f5da407
commit 7d2e67ad34
7 changed files with 313 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
using System.Collections.Generic;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Extensions
{
[TestFixture]
public sealed class CollectionExtensionsTest
{
[Test]
public void RemoveAllPredicateTest()
{
List<int> a = new List<int> {1, 2, 2, 3};
List<int> b = new List<int> {2, 3};
((ICollection<int>)a).RemoveAll(i => b.Contains(i));
Assert.AreEqual(1, a.Count);
Assert.AreEqual(1, a[0]);
}
[Test]
public void RemoveAllOtherTest()
{
List<int> a = new List<int> {1, 2, 2, 3};
List<int> b = new List<int> {2, 3};
a.RemoveAll(b);
Assert.AreEqual(1, a.Count);
Assert.AreEqual(1, a[0]);
}
}
}