public DictionaryTestCase(double timeLimit, Exception expectedException, string description, IListDictionary testedDict, OperationInfo[] operations, int[] expectedFinalState) : base(timeLimit, expectedException, description) { this.testedDict = testedDict; this.operations = operations; this.expectedFinalState = expectedFinalState; }
public bool[] Execute(IListDictionary TestedDict, OperationInfo[] operations) { bool[] res = new bool[operations.Length]; for (int i = 0; i < operations.Length; ++i) { switch (operations[i].oper) { case 'a': res[i] = TestedDict.Add(operations[i].val); break; case 's': res[i] = TestedDict.Search(operations[i].val); break; case 'd': res[i] = TestedDict.Delete(operations[i].val); break; } } return(res); }
public static bool Contains <TKey, TValue>(IListDictionary <TKey, TValue> listDictionary, TKey key, TValue value) { return(listDictionary.GetValues(key).Contains(value)); }
public static IEnumerable <TValue> GetValues <TKey, TValue>(this IListDictionary <TKey, TValue> listDictionary) { return(listDictionary.Values); }