CK.Core.Tests.UtilInterlockedTests.InterlockedRemoveAll_items_that_match_a_condition C# (CSharp) Method

InterlockedRemoveAll_items_that_match_a_condition() private method

private InterlockedRemoveAll_items_that_match_a_condition ( ) : void
return void
        public void InterlockedRemoveAll_items_that_match_a_condition()
        {
            int[] a = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            Util.InterlockedRemoveAll( ref a, i => i % 2 == 0 );
            CollectionAssert.AreEqual( a, new[] { 1, 3, 5, 7, 9 } );
            Util.InterlockedRemoveAll( ref a, i => i % 2 != 0 );
            CollectionAssert.AreEqual( a, Util.Array.Empty<int>() );

            a = null;
            Util.InterlockedRemoveAll( ref a, i => i % 2 != 0 );
            Assert.That( a, Is.Null );

        }