コード例 #1
0
        public void TestCanLogDataPT01()
        {
            //Testing --- NextSampleTime is null ... first time logging the datapoint
            OPCLoggerQuene  oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            OPCDPGrpDetails opcDPGrp               = OPCDPGrpDetailsFactory.CreateOPCDPGrpDetails01();
            Accessor        oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);
            //Test Procedure Call
            bool b = (bool)oPCLoggerQueneAccessor.Call("CanLogDataPT", opcDPGrp);

            //Post Condition Check
            Assert.IsTrue(b);
        }
コード例 #2
0
        public void TestCanLogDataPT03()
        {
            //testing -- current time is less than next sample time of datapoint
            OPCLoggerQuene  oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            OPCDPGrpDetails opcDPGrp               = OPCDPGrpDetailsFactory.CreateOPCDPGrpDetails01();
            Accessor        oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            opcDPGrp.NextSampleTime = DateTime.Now;
            //Test Procedure Call
            bool b = (bool)oPCLoggerQueneAccessor.Call("CanLogDataPT", opcDPGrp);

            //Post Condition Check
            Assert.IsFalse(b);
        }
コード例 #3
0
        public void TestNextSampleTimeGetter01()
        {
            OPCDPGrpDetails oPCDPGrpDetails = OPCDPGrpDetailsFactory.CreateOPCDPGrpDetails01();
            DateTime?       nextSampleTime  = oPCDPGrpDetails.NextSampleTime;

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((double)oPCDPGrpDetails.Delta);
            recorder.Record((string)oPCDPGrpDetails.DT_PT_Name);
            recorder.Record((double)oPCDPGrpDetails.Interval);
            recorder.Record((string)oPCDPGrpDetails.OldValue);
            recorder.Record((string)oPCDPGrpDetails.Value);
            recorder.Record <bool>(delegate { return((bool)nextSampleTime.HasValue); });
            recorder.FinishRecording();
            #endregion
        }
コード例 #4
0
        public void TestValueSetter01()
        {
            OPCDPGrpDetails oPCDPGrpDetails = OPCDPGrpDetailsFactory.CreateOPCDPGrpDetails01();
            string          value1          = string.Empty;

            oPCDPGrpDetails.Value = value1;
            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((double)oPCDPGrpDetails.Delta);
            recorder.Record((string)oPCDPGrpDetails.DT_PT_Name);
            recorder.Record((double)oPCDPGrpDetails.Interval);
            recorder.Record((string)oPCDPGrpDetails.OldValue);
            recorder.Record((string)oPCDPGrpDetails.Value);
            recorder.FinishRecording();
            #endregion
        }
コード例 #5
0
        public void TestDeltaSetter01()
        {
            OPCDPGrpDetails oPCDPGrpDetails = OPCDPGrpDetailsFactory.CreateOPCDPGrpDetails01();
            double          delta           = double.MaxValue;

            oPCDPGrpDetails.Delta = delta;
            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((double)oPCDPGrpDetails.Delta);
            recorder.Record((string)oPCDPGrpDetails.DT_PT_Name);
            recorder.Record((double)oPCDPGrpDetails.Interval);
            recorder.Record((string)oPCDPGrpDetails.OldValue);
            recorder.Record((string)oPCDPGrpDetails.Value);
            recorder.FinishRecording();
            #endregion
        }