public AbstractSemanticObject[] BuildBs()
        {
            AbstractSemanticObject[] result = new AbstractSemanticObject[5];
            SemanticObjectA a = new SemanticObjectA();
            SemanticObjectC lastC = null;
            for (int i = 0; i < 5; i++)
            {
                SemanticObjectB b = new SemanticObjectB
                                    {
                                        IntProperty = i,
                                        StringProperty = s_SomeStrings[i]
                                    };

                for (int j = 0; j < 10; j++)
                {
                    SemanticObjectC c = new SemanticObjectC
                                        {
                                            B = b,
                                            A = a
                                        };
                    lastC = c;
                }

                b.A = a;
                result[i] = b;
            }

            // this creates a loop, as it is downstream, but not a collection
            a.C = lastC;
            return result;
        }
Example #2
0
        public AbstractSemanticObject[] BuildBs()
        {
            AbstractSemanticObject[] result = new AbstractSemanticObject[5];
            SemanticObjectA          a      = new SemanticObjectA();
            SemanticObjectC          lastC  = null;

            for (int i = 0; i < 5; i++)
            {
                SemanticObjectB b = new SemanticObjectB
                {
                    IntProperty    = i,
                    StringProperty = s_SomeStrings[i]
                };

                for (int j = 0; j < 10; j++)
                {
                    SemanticObjectC c = new SemanticObjectC
                    {
                        B = b,
                        A = a
                    };
                    lastC = c;
                }

                b.A       = a;
                result[i] = b;
            }

            // this creates a loop, as it is downstream, but not a collection
            a.C = lastC;
            return(result);
        }
Example #3
0
        public void CreateAbstractSemanticObject()
        {
            AbstractSemanticObject result = new SemanticObjectB();

            Assert.IsNotNull(result);
            result = new SemanticObjectA();
            Assert.IsNotNull(result);
            result = new SemanticObjectC();
            Assert.IsNotNull(result);
        }
Example #4
0
        internal void AddC(SemanticObjectC c)
        {
            Contract.Requires(c != null);
            Contract.Requires(c.B == this);
            Contract.Ensures(Cs.Contains(c));

            if (!m_Cs.Contains(c))
            {
                m_Cs.Add(c);
            }
        }
        internal void RemoveC(SemanticObjectC c)
        {
            Contract.Ensures(!Cs.Contains(c));

            m_Cs.Remove(c);
        }
        internal void AddC(SemanticObjectC c)
        {
            Contract.Requires(c != null);
            Contract.Requires(c.B == this);
            Contract.Ensures(Cs.Contains(c));

            if (!m_Cs.Contains(c))
            {
                m_Cs.Add(c);
            }
        }
Example #7
0
        internal void RemoveC(SemanticObjectC c)
        {
            Contract.Ensures(!Cs.Contains(c));

            m_Cs.Remove(c);
        }
 public void CreateAbstractSemanticObject()
 {
     AbstractSemanticObject result = new SemanticObjectB();
     Assert.IsNotNull(result);
     result = new SemanticObjectA();
     Assert.IsNotNull(result);
     result = new SemanticObjectC();
     Assert.IsNotNull(result);
 }
 public void CreateAbstractSemanticObject()
 {
     AbstractSemanticObject result = new SemanticObjectB();
     result = new SemanticObjectA();
     result = new SemanticObjectC();
 }