Esempio n. 1
0
        public void ShouldReturnTrueIfElementExists()
        {
            SortableCollection.SortableCollection collection = new SortableCollection.SortableCollection(new int[] { 1, 5, 4, 2, 7, -1, 0 });

            Assert.IsTrue(collection.LinearSearch(4));
        }
        public void ShouldReturnTrueIfElementExists()
        {
            SortableCollection.SortableCollection collection = new SortableCollection.SortableCollection(new int[] { 1, 2, 4, 6, 8, 11, 17 });

            Assert.IsTrue(collection.BinarySearch(4));
        }
Esempio n. 3
0
        public void ShouldReturnFalseIfElementDoesNotExist()
        {
            SortableCollection.SortableCollection collection = new SortableCollection.SortableCollection(new int[] { 1, 5, 4, 2, 7, -1, 0 });

            Assert.IsFalse(collection.LinearSearch(3));
        }
        public void ShouldReturnFalseIfElementDoesNotExist()
        {
            SortableCollection.SortableCollection collection = new SortableCollection.SortableCollection(new int[] { 1, 2, 4, 6, 8, 11, 17 });

            Assert.IsFalse(collection.BinarySearch(3));
        }