コード例 #1
0
        public void CanReach_GivenNeighbor_ReturnsTrue()
        {
            var a = new ProgramGraphNode(1);
            var b = new ProgramGraphNode(2);

            a.AddNeighbor(b);
            Assert.IsTrue(a.CanReach(b.Id));
            Assert.IsTrue(b.CanReach(a.Id));
        }
コード例 #2
0
        public void AddNeighbor_AddsNeighborOnBothSides()
        {
            var a = new ProgramGraphNode(1);
            var b = new ProgramGraphNode(2);

            a.AddNeighbor(b);
            Assert.Contains(a, b.Neighbors.ToList());
            Assert.Contains(b, a.Neighbors.ToList());
        }
コード例 #3
0
        public void CanReach_GivenSelf_ReturnsTrue()
        {
            var a = new ProgramGraphNode(1);

            Assert.IsTrue(a.CanReach(1));
        }