Beispiel #1
0
        internal void AddEdge(NetworkComponent target, NetworkLink link)
        {
            if (target == null)
            {
                return;
            }
            ComponentPairing t = new ComponentPairing()
            {
                Source = this.ComponentGuid,
                Target = target.ComponentGuid
            };

            Connections.Add(target);
            FullyConnectedConnections.Add(new FullNode()
            {
                Source = this, Target = target, Link = link
            });
        }
Beispiel #2
0
        public void EqualsTest()
        {
            Guid             a    = Guid.NewGuid();
            Guid             b    = Guid.NewGuid();
            ComponentPairing pair = new ComponentPairing()
            {
                Source = a,
                Target = b
            };
            ComponentPairing pair2 = new ComponentPairing()
            {
                Source = b,
                Target = a
            };

            Assert.IsTrue(pair.Equals(pair2));
            Assert.AreEqual(pair, pair2);

            Dictionary <ComponentPairing, string> test = new Dictionary <ComponentPairing, string>();

            test.Add(pair, "Pair1");
            Assert.ThrowsException <ArgumentException>(() => { test.Add(pair2, "Pair2"); });
        }