public void MyLinkedList_5_Insert_02_ThrowsExceptionOnIndexTooHighOnEmptyList() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); // Act & Assert Assert.Throws(typeof(MyLinkedListIndexOutOfRangeException), () => lst.Insert(1, "1")); }
public void MyLinkedList_1_Constructor0_2_ThrowsExceptionOnGetFirst() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); // Act & Assert Assert.Throws(typeof(MyLinkedListEmptyException), () => lst.GetFirst()); }
public void MyLinkedList_3_RemoveFirst_1_ThrowsExceptionOnEmptyList() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); // Act & Assert Assert.Throws(typeof(MyLinkedListEmptyException), () => lst.RemoveFirst()); }
public void MyLinkedList_5_Insert_04_ThrowsExceptionOnIndexTooHighOnList3() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); // Act & Assert Assert.Throws(typeof(MyLinkedListIndexOutOfRangeException), () => lst.Insert(4, "4")); }
public void MyLinkedList_1_Constructor0_1_SizeEquals0() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); int expected = 0; // Act int actual = lst.Size(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_6_ToString_1_OnEmptyList() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); string expected = "NIL"; // Act string actual = lst.ToString(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_4_Clear_1_SizeEquals0OnEmptyList() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); int expected = 0; // Act lst.Clear(); int actual = lst.Size(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_3_RemoveFirst_4_ThrowsExceptionOnGetFirstAdter1Insert() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); // Act lst.RemoveFirst(); // Act & Assert Assert.Throws(typeof(MyLinkedListEmptyException), () => lst.GetFirst()); }
public void MyLinkedList_2_AddFirst_3_GetFirstOkAfter1Insert() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); string expected = "1"; // Act lst.AddFirst("1"); string actual = lst.GetFirst(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_2_AddFirst_1_SizeEquals1After1Insert() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); int expected = 1; // Act lst.AddFirst("1"); int actual = lst.Size(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_5_Insert_05_SizeEquals1AfterInsertAtBeginningOnEmptyList() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); int expected = 1; // Act lst.Insert(0, "1"); int actual = lst.Size(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_5_Insert_06_GetFirstOkAfterInsertAtBeginningOnEmptyList() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); string expected = "1"; // Act lst.Insert(0, "1"); string actual = lst.GetFirst(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_6_ToString_2_OnList3() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); string expected = "[3,2,1]"; // Act string actual = lst.ToString(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_3_RemoveFirst_3_SizeEquals2After3Inserts() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); int expected = 2; // Act lst.RemoveFirst(); int actual = lst.Size(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_5_Insert_13_GetFirstOkAfterInsertInMiddleOnList3() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); string expected = "3"; // Act lst.Insert(1, "4"); string actual = lst.GetFirst(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_5_Insert_12_SizeEquals4AfterInsertInMiddleOnList3() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); int expected = 4; // Act lst.Insert(1, "4"); int actual = lst.Size(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_3_RemoveFirst_5_GetFirstOkAfter3Inserts() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); string expected = "2"; // Act lst.RemoveFirst(); string actual = lst.GetFirst(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_4_Clear_3_SizeEquals0OnList3() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); int expected = 0; // Act lst.Clear(); int actual = lst.Size(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_6_ToString_4_VariousOperations2() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.Insert(1, "4"); lst.RemoveFirst(); string expected = "[4,1]"; // Act string actual = lst.ToString(); // Assert Assert.AreEqual(expected, actual); }
public void MyLinkedList_5_Insert_11_GetLastOkAfterInsertAtEndOnList3() { // Arrange IMyLinkedList <string> lst = DSBuilder.CreateMyLinkedList(); lst.AddFirst("1"); lst.AddFirst("2"); lst.AddFirst("3"); string expected = "4"; // Act lst.Insert(3, "4"); lst.RemoveFirst(); lst.RemoveFirst(); lst.RemoveFirst(); string actual = lst.GetFirst(); // Assert Assert.AreEqual(expected, actual); }