public override void Creates_Appropriate_Message()
        {
            var bytes = new byte[]
                            {
                                MessageConstants.SYSEX_START,
                                SysexCommands.SAMPLING_INTERVAL,
                                34,
                                54,
                                MessageConstants.SYSEX_END
                            };

            var message = new SamplingIntervalMessage() {Interval = BitHelper.BytesToInt(34, 54)};
            var creator = new SamplingIntervalMessageCreator();
            var newBytes = creator.CreateMessage(message);
            Assert.AreEqual(bytes,newBytes);
        }
Example #2
0
        public override void Creates_Appropriate_Message()
        {
            var bytes = new byte[]
            {
                MessageConstants.SYSEX_START,
                SysexCommands.SAMPLING_INTERVAL,
                34,
                54,
                MessageConstants.SYSEX_END
            };

            var message = new SamplingIntervalMessage()
            {
                Interval = BitHelper.BytesToInt(34, 54)
            };
            var creator  = new SamplingIntervalMessageCreator();
            var newBytes = creator.CreateMessage(message);

            Assert.AreEqual(bytes, newBytes);
        }
 public override void Throws_Error_On_Wrong_Message()
 {
     var creator = new SamplingIntervalMessageCreator();
     Assert.Throws<MessageCreatorException>(() => creator.CreateMessage(new AnalogMessage()));
 }
Example #4
0
        public override void Throws_Error_On_Wrong_Message()
        {
            var creator = new SamplingIntervalMessageCreator();

            Assert.Throws <MessageCreatorException>(() => creator.CreateMessage(new AnalogMessage()));
        }