예제 #1
0
 public void TestisNumeric01()
 {
     OPCLoggerCache oPCLoggerCache = OPCLoggerCacheFactory.CreateOPCLoggerCache02();
     string         val            = "22";
     NumberStyles   numberStyle    = NumberStyles.AllowTrailingSign;
     bool           b = oPCLoggerCache.isNumeric(val, numberStyle);
 }
예제 #2
0
        public void TestInitializeDataLogger02()
        {
            OPCLoggerCache oPCLoggerCache         = OPCLoggerCacheFactory.CreateOPCLoggerCache02();
            Accessor       oPCLoggerCacheAccessor = ReflectionAccessor.Wrap(oPCLoggerCache);

            //Test3 ----- Valid setup
            oPCLoggerCache.InitializeDataLogger();
        }
예제 #3
0
        public void TestLoadDataPointTimeStamp01()
        {
            OPCLoggerCache oPCLoggerCache         = OPCLoggerCacheFactory.CreateOPCLoggerCache02();
            Accessor       oPCLoggerCacheAccessor = ReflectionAccessor.Wrap(oPCLoggerCache);

            //TODO STUB DB Result
            oPCLoggerCache.LoadDataPointTimeStamp();
            //Post Test Condition Check
            Assert.AreNotEqual(0, oPCLoggerCacheAccessor.GetFieldAccessor("m_DataPointdic").GetProperty("Count"));
        }
예제 #4
0
        public void TestClearDataPoints01()
        {
            OPCLoggerCache oPCLoggerCache                     = OPCLoggerCacheFactory.CreateOPCLoggerCache02();
            Accessor       oPCLoggerCacheAccessor             = ReflectionAccessor.Wrap(oPCLoggerCache);
            Dictionary <string, OPCDPGrpDetails> dataPointdic = new Dictionary <string, OPCDPGrpDetails>();

            dataPointdic.Add("Datapoint1.Value", new OPCDPGrpDetails());
            oPCLoggerCacheAccessor.SetField("m_DataPointdic", dataPointdic);
            oPCLoggerCache.ClearDataPoints();
            //Post test condition check
            Assert.AreEqual(0, oPCLoggerCacheAccessor.GetFieldAccessor("m_DataPointdic").GetProperty("Count"));
        }
예제 #5
0
        public void TestInitializeDataLogger01()
        {
            OPCLoggerCache oPCLoggerCache         = OPCLoggerCacheFactory.CreateOPCLoggerCache02();
            Accessor       oPCLoggerCacheAccessor = ReflectionAccessor.Wrap(oPCLoggerCache);

            //Test1 ----- invalid database string
            oPCLoggerCacheAccessor.SetField("m_localConnectionString", "DataSource=;UserID=;Password=;");
            oPCLoggerCache.InitializeDataLogger();

            //Test2 ----- Valid database string but cannot connect to OPC
            //TODO Stub
            oPCLoggerCache.InitializeDataLogger();
        }
예제 #6
0
        public void TestGetNextSampleTime01()
        {
            OPCLoggerCache oPCLoggerCache         = OPCLoggerCacheFactory.CreateOPCLoggerCache02();
            DateTime       currenttime            = DateTime.Now;
            string         startTime              = string.Format("{0}:{1}", currenttime.Hour, currenttime.Minute);
            double         intervalInSecs         = 120;
            Accessor       oPCLoggerCacheAccessor = ReflectionAccessor.Wrap(oPCLoggerCache);
            DateTime       dateTime = (DateTime)oPCLoggerCacheAccessor.Call("GetNextSampleTime", startTime, intervalInSecs);
            //Post Test Condition Check
            DateTime time = new DateTime(currenttime.Year, currenttime.Month, currenttime.Day, currenttime.Hour, currenttime.Minute, 0);

            Assert.AreEqual(time, dateTime);
        }
예제 #7
0
 public void TestGetLoggerInterval01()
 {
     OPCLoggerCache oPCLoggerCache = OPCLoggerCacheFactory.CreateOPCLoggerCache02();
     int            i = oPCLoggerCache.GetLoggerInterval();
 }