Skip to content

Commit 70c3d74

Browse files
added test cases for codecov
1 parent 9684551 commit 70c3d74

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

DataStructures.Tests/LinkedList/CircularLinkedListTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using DataStructures.LinkedList.CircularLinkedList;
3+
using Microsoft.VisualStudio.TestPlatform.Utilities;
34
using NUnit.Framework;
45

56
namespace DataStructures.Tests.LinkedList;
@@ -18,6 +19,15 @@ public static void TestDisplay()
1819
Assert.That("10 20 30", Is.EqualTo(GetDisplayOutput(cll).Trim()));
1920
}
2021

22+
[Test]
23+
public static void TestDisplayEmptyList()
24+
{
25+
var cll = new CircularLinkedList<int>();
26+
cll.Display();
27+
28+
Assert.That("List is empty.", Is.EqualTo(GetDisplayOutput(cll).Trim()));
29+
}
30+
2131
[Test]
2232
public static void TestInsertAtBeginning()
2333
{
@@ -69,6 +79,17 @@ public static void TestInsertAtEndInEmptyList()
6979
Assert.That("10", Is.EqualTo(GetDisplayOutput(cll).Trim()));
7080
}
7181

82+
[Test]
83+
public static void TestInsertAfterInEmptyList()
84+
{
85+
var cll = new CircularLinkedList<int>();
86+
cll.InsertAfter(10, 20);
87+
88+
Assert.That("List is empty.", Is.EqualTo(GetDisplayOutput(cll).Trim()));
89+
}
90+
91+
92+
7293
[Test]
7394
public static void TestInsertAfterSpecificNode()
7495
{

0 commit comments

Comments
 (0)