mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-12 19:25:00 +00:00
Additional unit tests and test stubs
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user