public void ConstructorTest() { TagConfigDatabase db = TagConfigDatabase.Instance; db.Load(_tagRecords); TagStateManager tsm = new TagStateManager(db); Assert.AreEqual("AirConditioner1.Temperature", tsm.GetTag("AirConditioner1.Temperature").Name); }
public void UpdateTagTest() { TagConfigDatabase db = TagConfigDatabase.Instance; db.Load(_tagRecords); TagStateManager tsm = new TagStateManager(db); Dictionary <string, object> fields = new Dictionary <string, object> { { "Quality", "1" } }; tsm.UpdateTag <double>("AirConditioner1.Temperature", DateTime.UtcNow, 77.5D, fields); tsm.UpdateTag <double>("AirConditioner1.Temperature", DateTime.UtcNow, 79.4D, fields); var tag = tsm.GetTag("AirConditioner1.Temperature"); DataPoint <double> dp = (DataPoint <double>)tag.DataPoints["AirConditioner1.Temperature"]; Assert.AreEqual(79.4D, dp.Val); }