Пример #1
0
 public void HasGetSet()
 {
     var value = new Establishment();
     var entity = new EstablishmentNode { Offspring = value };
     entity.ShouldNotBeNull();
     entity.Offspring.ShouldEqual(value);
 }
Пример #2
0
        private static void BuildNodesRecursive(Establishment parent)
        {
            // operate recursively over children
            foreach (var child in parent.Children)
            {
                // create & add ancestor node for this child
                var node = new EstablishmentNode
                {
                    Ancestor   = parent,
                    Offspring  = child,
                    Separation = 1,
                };
                child.Ancestors.Add(node);

                // loop over the parent's ancestors
                foreach (var ancestor in parent.Ancestors)
                {
                    // create & add ancestor node for this child
                    node = new EstablishmentNode
                    {
                        Ancestor   = ancestor.Ancestor,
                        Offspring  = child,
                        Separation = ancestor.Separation + 1,
                    };
                    child.Ancestors.Add(node);
                }

                // run this method again on the child
                BuildNodesRecursive(child);
            }
        }
Пример #3
0
 public void HasGetSet()
 {
     const int value = 5;
     var entity = new EstablishmentNode { OffspringId = value };
     entity.ShouldNotBeNull();
     entity.OffspringId.ShouldEqual(value);
 }
Пример #4
0
 public void HasGetSet()
 {
     var value = new Establishment();
     var entity = new EstablishmentNode { Ancestor = value };
     entity.ShouldNotBeNull();
     entity.Ancestor.ShouldEqual(value);
 }
Пример #5
0
 public void HasGetSet()
 {
     const int value = 3;
     var entity = new EstablishmentNode { AncestorId = value };
     entity.ShouldNotBeNull();
     entity.AncestorId.ShouldEqual(value);
 }
            public void HasGetSet()
            {
                var value  = new Establishment();
                var entity = new EstablishmentNode {
                    Offspring = value
                };

                entity.ShouldNotBeNull();
                entity.Offspring.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                const int value  = 5;
                var       entity = new EstablishmentNode {
                    OffspringId = value
                };

                entity.ShouldNotBeNull();
                entity.OffspringId.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                var value  = new Establishment();
                var entity = new EstablishmentNode {
                    Ancestor = value
                };

                entity.ShouldNotBeNull();
                entity.Ancestor.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                const int value  = 3;
                var       entity = new EstablishmentNode {
                    AncestorId = value
                };

                entity.ShouldNotBeNull();
                entity.AncestorId.ShouldEqual(value);
            }