コード例 #1
0
        public void AllElementsConnectedToANodeCanBeFound()
        {
            IList <IFiniteElement> results = SUT.GetAllElementsConnectedTo(node1);

            Assert.IsNotNull(results);
            Assert.AreEqual(1, results.Count);
            Assert.IsTrue(results.Contains(spring1));

            results = SUT.GetAllElementsConnectedTo(node2);
            Assert.IsNotNull(results);
            Assert.AreEqual(2, results.Count);
            Assert.IsTrue(results.Contains(spring1));
            Assert.IsTrue(results.Contains(spring2));

            results = SUT.GetAllElementsConnectedTo(node3);
            Assert.IsNotNull(results);
            Assert.AreEqual(1, results.Count);
            Assert.IsTrue(results.Contains(spring2));

            FiniteElementNode unconnectedNode = nodeFactory.CreateFor2DTruss(0, 3);

            results = SUT.GetAllElementsConnectedTo(unconnectedNode);
            Assert.IsNotNull(results);
            Assert.AreEqual(0, results.Count);
        }