Beispiel #1
0
        public void RemoveEdge_Throws_Ex_If_Edge_Is_Invalid_Type()
        {
            var net =new BasicAdjList(Guid.NewGuid());
            BasicNode node0 = new BasicNode(net);

            DummyBasicEdge edge0 = new DummyBasicEdge();
            var ex = Assert.Throws<ArgumentException>(() => node0.RemoveEdge(edge0));
        }
Beispiel #2
0
        public void RemoveEdge_Throws_Ex_If_Edge_Is_Null()
        {
            var net =new BasicAdjList(Guid.NewGuid());
            BasicNode node0 = new BasicNode(net);

            BasicEdge edge0 = null;
            var ex = Assert.Throws<ArgumentNullException>(() => node0.RemoveEdge(edge0));
        }
Beispiel #3
0
        public void RemoveEdge_DecrementsDegree()
        {
            var net =new BasicAdjList(Guid.NewGuid());
            BasicNode node0 = new BasicNode(net);
            BasicNode node1 = new BasicNode(net);

            BasicEdge edge0 = new BasicEdge(net, node0, node1);

            node0.AddEdge(edge0);
            Assert.Equal(1, node0.Degree);

            node0.RemoveEdge(edge0);
            Assert.Equal(0, node0.Degree);
        }