Skip to content

Commit 3abfdd7

Browse files
committed
Update 0001_BreadthFirstSearchTest.cc
1 parent 9298d7c commit 3abfdd7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Tests/0003_Graph/0001_BreadthFirstSearchTest.cc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// Demonstrate some basic assertions.
66
namespace BreadthFirstSearchTest
77
{
8-
TEST(BFSTesting, ShowBFSResultTest) {
8+
TEST(BFSTesting, ShowBFSResultTest01)
9+
{
910
BFSGraph graph;
1011

1112
graph.PushUndirectedEdge('s', 'r');
@@ -25,4 +26,17 @@ namespace BreadthFirstSearchTest
2526
string expectedResult = " r(1) s(0) t(2) u(3) v(2) w(1) x(2) y(3)";
2627
EXPECT_EQ(actualResult, expectedResult);
2728
}
29+
30+
TEST(BFSTesting, ShowBFSResultTest02)
31+
{
32+
BFSGraph graph;
33+
34+
graph.PushUndirectedEdge('s', 'r');
35+
36+
graph.BFS('s');
37+
38+
string actualResult = graph.ShowBFSResult();
39+
string expectedResult = " r(1) s(0)";
40+
EXPECT_EQ(actualResult, expectedResult);
41+
}
2842
}

0 commit comments

Comments
 (0)