Skip to content

Commit 6a9e642

Browse files
committed
Fixed failing unit test
1 parent 79c3f97 commit 6a9e642

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

UnitTest/DataStructuresTests/CircularBufferTest.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ public static void TestingCantOverrideFunctionality()
102102
circularBuffer.Write(3);
103103
circularBuffer.Write(34);
104104
circularBuffer.Write(24);
105-
// if it doesn't override, then the values above will be read else,
106-
// the value below will be read
107-
circularBuffer.Write(2);
108-
circularBuffer.Write(1);
109-
circularBuffer.Write(3);
110-
105+
// if it doesn't override, then it will throw CircularBufferFullException
106+
Assert.Throws<CircularBufferFullException>(() =>
107+
{
108+
circularBuffer.Write(2);
109+
});
110+
111+
// Ensuring that it reads the appropriate values in the buffer.
111112
var result1 = circularBuffer.Read();
112113
var result2 = circularBuffer.Read();
113114
var result3 = circularBuffer.Read();

0 commit comments

Comments
 (0)