using System.Utility; using NUnit.Framework; namespace Chernobyl.Collections.Generic { /// /// Tests for the . /// public class CollectionExtensionsTests { [Test, Description("Ensures IsInBounds returns false when index is less than zero.")] public void BoundsReturnsFalseWhenIndexIsLessThanLength() => (new[] { 1, 2, 3 }).IsInBounds(-1).IsFalse("CollectionExtensions.IsInBounds"); [Test, Description("Ensures IsInBounds returns false when greater than ICollection's length.")] public void BoundsReturnsFalseWhenIndexIsGreaterThanLength() => (new[] { 1, 2, 3 }).IsInBounds(3).IsFalse("CollectionExtensions.IsInBounds"); [Test, Description("Ensures IsInBounds returns true when within ICollection.")] public void BoundsReturnsTrueWhenIndexIsWithinICollection() => (new[] { 1, 2, 3 }).IsInBounds(2).IsTrue("CollectionExtensions.IsInBounds"); } }