Esempio n. 1
0
        public void TestRun01()
        {
            OPCLoggerWriteQuene oPCLoggerWriteQuene         = DotTest.Factories.OPCLoggerWriteQueneFactory.CreateOPCLoggerWriteQuene01();
            Accessor            oPCLoggerWriteQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerWriteQuene);

            //Test Procedure Call
            //push a item
            Entity.Trending.EtyTrendLog etyTrendLog = new Entity.Trending.EtyTrendLog();
            oPCLoggerWriteQuene.PushToQuene(etyTrendLog);
            oPCLoggerWriteQuene.PushToQuene(new Entity.Trending.EtyTrendLog());
            oPCLoggerWriteQuene.PushToQuene(new Entity.Trending.EtyTrendLog());
            System.Threading.ThreadStart func = new System.Threading.ThreadStart(oPCLoggerWriteQuene.Run);
            System.Threading.Thread      t1   = new System.Threading.Thread(func);
            t1.Start();
            //m_signal.WaitOne();
            //Post Condition Check
            // Assert.AreEqual(0, oPCLoggerWriteQueneAccessor.GetFieldAccessor("m_writeQuene").GetProperty("Count"));
        }
Esempio n. 2
0
        public void TestPushToQuene01()
        {
            OPCLoggerWriteQuene oPCLoggerWriteQuene         = new OPCLoggerWriteQuene();
            Accessor            oPCLoggerWriteQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerWriteQuene);
            Queue <Entity.Trending.EtyTrendLog> writeQuene  = new Queue <Entity.Trending.EtyTrendLog>();

            for (int i = 0; i < 100001; i++)
            {
                writeQuene.Enqueue(new Entity.Trending.EtyTrendLog());
            }
            oPCLoggerWriteQueneAccessor.SetField("m_writeQuene", writeQuene);
            //TODO stub for Max Count
            //Test Procedure Call
            oPCLoggerWriteQuene.PushToQuene(new Entity.Trending.EtyTrendLog());
            //Post Condition Check
            Assert.AreEqual(100001, oPCLoggerWriteQueneAccessor.GetFieldAccessor("m_writeQuene").GetProperty("Count"));
        }