Exemple #1
0
        public void FromSingle_Value_PayloadHasValue()
        {
            float value   = (float)Math.E;
            var   message = HarpCommand.WriteSingle(DefaultAddress, value);

            AssertIsValid(message);
            Assert.AreEqual(value, message.GetPayloadSingle());
        }
Exemple #2
0
        public void FromSingle_Array_PayloadHasValue()
        {
            var value   = new float[] { (float)Math.PI, 1 / 3f };
            var message = HarpCommand.WriteSingle(DefaultAddress, value);

            AssertIsValid(message);
            var payload = message.GetPayloadArray <float>();

            AssertArrayEqual(value, payload);
            Assert.AreEqual(value[1], message.GetPayloadSingle(1));
        }