using System; using NUnit.Framework; using System.Collections.Generic; namespace Algorithms.Tests.Graph { [TestFixture] public class BreadthFirstSearch { static object[] DivideCasesForBFS = { new object[] { 4, true, 3, new List>() { new Tuple(1, 2), new Tuple(1, 3), new Tuple(2, 3), new Tuple(3, 1), new Tuple(3, 4), new Tuple(4, 4), }, "3->1->4->2" }, }; [TestCaseSource(nameof(DivideCasesForBFS))] public void TestDFS_ShouldGetExpectedResult(int totalNodes, bool isDirected, int source, List> edges, string expected) { List result = Algorithms.Graph.BreadthFirstSearch.BFSDriver(totalNodes, isDirected, source, edges); Assert.AreEqual(expected, string.Join("->", result)); } } }