public void TestisNumeric01() { OPCLoggerCache oPCLoggerCache = OPCLoggerCacheFactory.CreateOPCLoggerCache02(); string val = "22"; NumberStyles numberStyle = NumberStyles.AllowTrailingSign; bool b = oPCLoggerCache.isNumeric(val, numberStyle); }
public void TestInitializeDataLogger02() { OPCLoggerCache oPCLoggerCache = OPCLoggerCacheFactory.CreateOPCLoggerCache02(); Accessor oPCLoggerCacheAccessor = ReflectionAccessor.Wrap(oPCLoggerCache); //Test3 ----- Valid setup oPCLoggerCache.InitializeDataLogger(); }
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")); }
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")); }
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(); }
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); }
public void TestGetLoggerInterval01() { OPCLoggerCache oPCLoggerCache = OPCLoggerCacheFactory.CreateOPCLoggerCache02(); int i = oPCLoggerCache.GetLoggerInterval(); }