Example #1
0
        public void MustHave4NeighborExceptMostOuter([ValueSource(nameof(nums))] int num)
        {
            var bf = new BistellarFlip3D(num, 1);
            var rt = new DN(new d3(0, 0, 0), new d3(3, 0, 0), new d3(0, 3, 0), new d3(0, 0, 3));

            bf.Nodes.ForEach(n => {
                var t = n.tetrahedra;
                var c = 0;

                Assert.IsTrue(rt.Contains(t.a, true) && rt.Contains(t.b, true) &&
                              rt.Contains(t.c, true) && rt.Contains(t.d, true));
                if (rt.Contains(t.a, false))
                {
                    c++;
                }
                if (rt.Contains(t.b, false))
                {
                    c++;
                }
                if (rt.Contains(t.c, false))
                {
                    c++;
                }
                if (rt.Contains(t.d, false))
                {
                    c++;
                }
                if (c >= 2)
                {
                    Assert.IsTrue(n.neighbor.Count == 4);
                }
            });
        }
Example #2
0
        public void Contains()
        {
            DN dn1 = new DN("CN=Pete,OU=People,DC=example,DC=com");
            DN dn2 = new DN("OU=People,DC=example,DC=com");
            DN dn3 = new DN("DC=example,DC=com");

            Assert.IsTrue(dn2.Contains(dn1));
            Assert.IsTrue(dn3.Contains(dn1));
            Assert.IsTrue(dn3.Contains(dn2));

            Assert.IsFalse(dn1.Contains(dn2));
            Assert.IsFalse(dn1.Contains(dn3));
            Assert.IsFalse(dn2.Contains(dn3));
        }
Example #3
0
        public void Contains()
        {
            DN dn1 = new DN("CN=Pete,OU=People,DC=example,DC=com");
            DN dn2 = new DN("OU=People,DC=example,DC=com");
            DN dn3 = new DN("DC=example,DC=com");

            Assert.IsTrue(dn2.Contains(dn1));
            Assert.IsTrue(dn3.Contains(dn1));
            Assert.IsTrue(dn3.Contains(dn2));

            Assert.IsFalse(dn1.Contains(dn2));
            Assert.IsFalse(dn1.Contains(dn3));
            Assert.IsFalse(dn2.Contains(dn3));
        }
Example #4
0
 void ReplaceFacingNode(SG e, DN replacer)
 {
     if (!replacer.Contains(e))
     {
         return;
     }
     neighbor = neighbor.Select(n => n.Contains(e) ? replacer : n).ToList();
 }