public void ReadValueFloatTest() { TestDataEntity _data = new TestDataEntity() { Tags = GetData(), TimeStamp = DateTime.Now }; ReadDataEntity _instance = new ReadDataEntity(_data, new Block()); object _value = _instance.ReadValue(2, typeof(float)); Assert.IsTrue(_value is float); Assert.AreEqual <float>(26.9f, (float)_value); _value = _instance.ReadValue(3, typeof(float)); Assert.IsTrue(_value is float); Assert.AreEqual <float>(1368f, (float)_value); }
public void ReadValueArgumentOutOfRangeTest() { TestDataEntity _data = new TestDataEntity() { Tags = GetData(), TimeStamp = DateTime.Now }; ReadDataEntity _instance = new ReadDataEntity(_data, new Block()); object _value = _instance.ReadValue(8, typeof(float)); }
public void ReadValueWrongFormatTest() { TestDataEntity _data = new TestDataEntity() { Tags = GetData(), TimeStamp = DateTime.Now }; ReadDataEntity _instance = new ReadDataEntity(_data, new Block()); object _value = _instance.ReadValue(0, typeof(float)); }
public void ReadValueShortFormatExceptionTest() { TestDataEntity _data = new TestDataEntity() { Tags = GetData(), TimeStamp = DateTime.Now }; ReadDataEntity _instance = new ReadDataEntity(_data, new Block()); object _value = _instance.ReadValue(2, typeof(short)); }
public void ReadValueShortOverflowExceptionTest() { TestDataEntity _data = new TestDataEntity() { Tags = GetData(), TimeStamp = DateTime.Now }; _data.Tags[7] = "33000"; ReadDataEntity _instance = new ReadDataEntity(_data, new Block()); object _value = _instance.ReadValue(3, typeof(short)); }
public void ReadValueStringTest() { TestDataEntity _data = new TestDataEntity() { Tags = GetData(), TimeStamp = DateTime.Now }; ReadDataEntity _instance = new ReadDataEntity(_data, new Block()); object _value = _instance.ReadValue(0, typeof(string)); Assert.IsTrue(_value is string); Assert.AreEqual <string>("09-12-16", (string)_value); _value = _instance.ReadValue(1, typeof(string)); Assert.IsTrue(_value is string); Assert.AreEqual <string>("09:24:02", (string)_value); _value = _instance.ReadValue(2, typeof(string)); Assert.IsTrue(_value is string); Assert.AreEqual <string>("26.9", (string)_value); _value = _instance.ReadValue(3, typeof(string)); Assert.IsTrue(_value is string); Assert.AreEqual <string>("1368", (string)_value); }
public void ReadValueShortTest() { TestDataEntity _data = new TestDataEntity() { Tags = GetData(), TimeStamp = DateTime.Now }; ReadDataEntity _instance = new ReadDataEntity(_data, new Block()); object _value = _instance.ReadValue(3, typeof(short)); Assert.IsTrue(_value is short); Assert.AreEqual <long>(1368, (short)_value); }