public void HasGetSet()
 {
     const int value = 13;
     var entity = new InstitutionalAgreementNode { OffspringId = value };
     entity.ShouldNotBeNull();
     entity.OffspringId.ShouldEqual(value);
 }
 public void HasGetSet()
 {
     var value = new InstitutionalAgreement();
     var entity = new InstitutionalAgreementNode { Offspring = value };
     entity.ShouldNotBeNull();
     entity.Offspring.ShouldEqual(value);
 }
 public void HasGetSet()
 {
     const int value = 9;
     var entity = new InstitutionalAgreementNode { AncestorId = value };
     entity.ShouldNotBeNull();
     entity.AncestorId.ShouldEqual(value);
 }
 public void HasGetSet()
 {
     var value = new InstitutionalAgreement();
     var entity = new InstitutionalAgreementNode { Ancestor = value };
     entity.ShouldNotBeNull();
     entity.Ancestor.ShouldEqual(value);
 }
Exemple #5
0
        private static void BuildNodesRecursive(InstitutionalAgreement umbrella)
        {
            // operate recursively over children
            foreach (var child in umbrella.Children)
            {
                // create & add ancestor node for this child
                var node = new InstitutionalAgreementNode
                {
                    Ancestor   = umbrella,
                    Offspring  = child,
                    Separation = 1,
                };
                child.Ancestors.Add(node);

                // ensure the umbrella's ancestors nodes are not null
                umbrella.Ancestors = umbrella.Ancestors ?? new List <InstitutionalAgreementNode>();

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

                // run this method again on the child
                BuildNodesRecursive(child);
            }
        }
            public void HasGetSet()
            {
                var value  = new InstitutionalAgreement();
                var entity = new InstitutionalAgreementNode {
                    Offspring = value
                };

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

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

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

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