Пример #1
0
        public void FillWithOneColor_FillsExpectedVertices([NotNull] string relationships, char startVertex,
                                                           string expected)
        {
            var graph  = new LiteralGraph(relationships, true);
            var result = new List <char>();

            graph.FillWithOneColor(startVertex, vertex => result.Add(vertex));

            Assert.AreEqual(expected, string.Join(",", result));
        }
Пример #2
0
        public void FillWithOneColor_ThrowsException_ForNullApplyColor()
        {
            var graph = new LiteralGraph("A>1>B", true);

            Assert.Throws <ArgumentNullException>(() => graph.FillWithOneColor('A', null));
        }
Пример #3
0
        public void FillWithOneColor_ThrowsException_ForInvalidVertex()
        {
            var graph = new LiteralGraph("A>1>B", true);

            Assert.Throws <ArgumentException>(() => graph.FillWithOneColor('Z', v => { }));
        }