public void CheckIfThisExceptionsWorkCorrectly3() { var hashList = new DataStructures.HashingListDictionary <string, string>(10); hashList.Add("1", "Ana"); Assert.Throws <ArgumentException>(() => hashList.Add("1", "Andrei")); }
public void CheckIfAddWorksCorrectly2() { var hashList = new DataStructures.HashingListDictionary <int, string>(10); hashList.Add(1, "Ana"); hashList.Add(11, "Andrei"); Assert.Equal("Andrei", hashList[11]); }
public void CheckIfRemoveWorksCorrectly() { var hashList = new DataStructures.HashingListDictionary <int, string>(10); hashList.Add(1, "Ana"); hashList.Add(11, "Andrei"); hashList.Remove(1); Assert.False(hashList.ContainsKey(1)); }
public void CheckIfAddAfterRemoveWorksCorrectly() { var hashList = new DataStructures.HashingListDictionary <int, string>(10); hashList.Add(1, "Ana"); hashList.Add(11, "Andrei"); hashList.Add(13, "Andreas"); hashList.Remove(11); hashList.Add(11, "Paul"); Assert.NotEqual("Andrei", hashList[hashList.Find(11).actual]); }
public void CheckIfCopyToWorksCorrectly() { var hashList = new DataStructures.HashingListDictionary <int, string>(10); hashList.Add(1, "Ana"); hashList.Add(11, "Andrei"); KeyValuePair <int, string>[] array1 = { new KeyValuePair <int, string>(1, "Ana"), new KeyValuePair <int, string>(11, "Andrei") }; KeyValuePair <int, string>[] array2 = new KeyValuePair <int, string> [2]; hashList.CopyTo(array2, 0); Assert.Equal(array1, array2); }
public void CheckIfAddExceptionsWorkCorrectly4() { var hashList = new DataStructures.HashingListDictionary <string, string>(10); hashList.MakeFixedSize(); Assert.Throws <NotSupportedException>(() => hashList.Add("1", "Ana")); }
public void CheckIfAddExceptionsWorkCorrectly2() { var hashList = new DataStructures.HashingListDictionary <string, string>(10); const string key = null; Assert.Throws <ArgumentNullException>(() => hashList.Add(key, "Ana")); }
public void CheckIfCopyToExceptionsWorkCorrectly2() { var hashList = new DataStructures.HashingListDictionary <string, string>(10); hashList.Add("1", "Ana"); KeyValuePair <string, string>[] array = new KeyValuePair <string, string> [20]; Assert.Throws <ArgumentOutOfRangeException>(() => hashList.CopyTo(array, -1)); }
public void CheckIfThisExceptionsWorkCorrectly2() { var hashList = new DataStructures.HashingListDictionary <string, string>(10); hashList.Add("1", "Ana"); hashList.MakeReadOnly(); Assert.Throws <NotSupportedException>(() => hashList["string"] = "Banana"); }
public void CheckIfContainsExceptionsWorkCorrectly() { var hashList = new DataStructures.HashingListDictionary <string, string>(10); hashList.Add("1", "Ana"); const string key = null; Assert.Throws <ArgumentNullException>(() => hashList.Contains(new KeyValuePair <string, string>(key, "Andrei"))); }
public void CheckIfThisExceptionsWorkCorrectly1() { var hashList = new DataStructures.HashingListDictionary <string, string>(10); hashList.Add("1", "Ana"); string value; const string key = null; Assert.Throws <ArgumentNullException>(() => value = hashList[key]); }
public void CheckIfTryGetValueWorksCorrectly() { var hashList = new DataStructures.HashingListDictionary <int, string>(10); hashList.Add(1, "Ana"); string value; hashList.TryGetValue(1, out value); Assert.Equal("Ana", value); }