public void SetRootVertex()
        {
            var graph     = new AdjacencyGraph <CloneableTestVertex, Edge <CloneableTestVertex> >();
            var algorithm = new CloneableVertexGraphExplorerAlgorithm <CloneableTestVertex, Edge <CloneableTestVertex> >(graph);

            int rootVertexChangeCount = 0;

            algorithm.RootVertexChanged += (_, _) => ++ rootVertexChangeCount;

            var vertex1 = new CloneableTestVertex("1");

            algorithm.SetRootVertex(vertex1);
            Assert.AreEqual(1, rootVertexChangeCount);
            algorithm.TryGetRootVertex(out CloneableTestVertex root);
            Assert.AreSame(vertex1, root);

            // Not changed
            algorithm.SetRootVertex(vertex1);
            Assert.AreEqual(1, rootVertexChangeCount);
            algorithm.TryGetRootVertex(out root);
            Assert.AreSame(vertex1, root);

            var vertex2 = new CloneableTestVertex("2");

            algorithm.SetRootVertex(vertex2);
            Assert.AreEqual(2, rootVertexChangeCount);
            algorithm.TryGetRootVertex(out root);
            Assert.AreSame(vertex2, root);

            algorithm.SetRootVertex(vertex1);
            Assert.AreEqual(3, rootVertexChangeCount);
            algorithm.TryGetRootVertex(out root);
            Assert.AreSame(vertex1, root);
        }
        public void ComputeWithRoot_Throws()
        {
            var graph     = new AdjacencyGraph <CloneableTestVertex, Edge <CloneableTestVertex> >();
            var algorithm = new CloneableVertexGraphExplorerAlgorithm <CloneableTestVertex, Edge <CloneableTestVertex> >(graph);

            // ReSharper disable once AssignNullToNotNullAttribute
            Assert.Throws <ArgumentNullException>(() => algorithm.Compute(null));
            Assert.IsFalse(algorithm.TryGetRootVertex(out _));
        }