Class SearchTests
Implements test methods for search algorithms.
Inheritance
Inherited Members
Namespace: AlgorithmsAndDataStructuresTests.Algorithms.Search
Assembly: AlgorithmsAndDataStructuresTests.dll
Syntax
public class SearchTests
Fields
| Improve this Doc View SourceList
Sorted array of elements. Note that binary search expects a sorted array.
Declaration
public static readonly List<int> List
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int32> |
Methods
| Improve this Doc View SourceDistinctElements_ExpectsToSuccessfullyGetTheIndexOfTheirPosition(Func<List<Int32>, Int32, Int32, Int32, Int32>)
Tests the correctness of searchMethod
on an array with distinct elements.
Declaration
public static void DistinctElements_ExpectsToSuccessfullyGetTheIndexOfTheirPosition(Func<List<int>, int, int, int, int> searchMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Collections.Generic.List<System.Int32>, System.Int32, System.Int32, System.Int32, System.Int32> | searchMethod | The search method that is being tested. |
DistinctElements_ExpectsToSuccessfullyGetTheIndexOfTheirPosition(Func<List<Int32>, Int32, Int32>)
Tests the correctness of searchMethod
on an array with distinct elements.
Declaration
public static void DistinctElements_ExpectsToSuccessfullyGetTheIndexOfTheirPosition(Func<List<int>, int, int> searchMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Collections.Generic.List<System.Int32>, System.Int32, System.Int32> | searchMethod | The search method that is being tested. |
DuplicateElements_ExpectsToGetTheIndexOfOneOfTheDupliatesNoMatterHowManyTimeSearchIsPerformed(Func<List<Int32>, Int32, Int32, Int32, Int32>)
Tests the correctness of searchMethod
on an array with duplicate elements.
Declaration
public static void DuplicateElements_ExpectsToGetTheIndexOfOneOfTheDupliatesNoMatterHowManyTimeSearchIsPerformed(Func<List<int>, int, int, int, int> searchMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Collections.Generic.List<System.Int32>, System.Int32, System.Int32, System.Int32, System.Int32> | searchMethod | The search method that is being tested. |
DuplicateElements_ExpectsToGetTheIndexOfOneOfTheDupliatesNoMatterHowManyTimeSearchIsPerformed(Func<List<Int32>, Int32, Int32>)
Tests the correctness of searchMethod
on an array with duplicate elements.
Declaration
public static void DuplicateElements_ExpectsToGetTheIndexOfOneOfTheDupliatesNoMatterHowManyTimeSearchIsPerformed(Func<List<int>, int, int> searchMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Collections.Generic.List<System.Int32>, System.Int32, System.Int32> | searchMethod | The search method that is being tested. |
NonExistingElements_ExpectsToGetMinusOne(Func<List<Int32>, Int32, Int32, Int32, Int32>)
Tests the correctness of searchMethod
when the key does not exist in the array.
Declaration
public static void NonExistingElements_ExpectsToGetMinusOne(Func<List<int>, int, int, int, int> searchMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Collections.Generic.List<System.Int32>, System.Int32, System.Int32, System.Int32, System.Int32> | searchMethod | The search method that is being tested. |
NonExistingElements_ExpectsToGetMinusOne(Func<List<Int32>, Int32, Int32>)
Tests the correctness of searchMethod
when the key does not exist in the array.
Declaration
public static void NonExistingElements_ExpectsToGetMinusOne(Func<List<int>, int, int> searchMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Collections.Generic.List<System.Int32>, System.Int32, System.Int32> | searchMethod | The search method that is being tested. |