private static void CompareType <type>(SBUSNet_message _dateFrame, type _testValue)
 {
     for (int _bidx = 0; _bidx < C_RegistersCount; _bidx++)
     {
         type _rv = (type)_dateFrame.ReadValue(_bidx, typeof(type));
         Assert.AreEqual <type>(_testValue, _rv, String.Format("Value of type {1} in the frame at {0} are not expected", _bidx, typeof(type)));
     }
 }
Exemple #2
0
        public void RequestWrite_ReadValueTest()
        {
#if !DEBUG
            Assert.Inconclusive("This test requires DEBUG context");
#endif
            using (SBUSNet_message _frame = new SBUSNet_message(null))
            {
                Assert.IsNotNull(_frame, "Message is not created.");
                BlockAddress _tb = new BlockAddress((short)Medium_T.Text);
                _frame.Test_PrepareReqWriteValue(_tb, _tb.station);
                Assert.AreEqual(29, _frame.userDataLength, "The length of the request is not valid");
                object _retValue = _frame.ReadValue(0, typeof(string));
            }
        }
        private static void CompareString(SBUSNet_message _dateFrame, string _testValue)
        {
            string _rv = (string)_dateFrame.ReadValue(0, typeof(string));

            Assert.AreEqual <string>(_testValue, _rv, "Value of type string in the frame at are not equal");
        }