Ejemplo n.º 1
0
        public void Throws_Error_On_Wrong_Pin()
        {
            var creator = new PinStateQueryMessageCreator();

            Assert.Throws <MessageCreatorException>(() => creator.CreateMessage(new PinStateQueryMessage {
                Pin = 130
            }));
        }
        public override void Creates_Appropriate_Message()
        {
            var bytes = new byte[]
                {
                    MessageConstants.SYSEX_START,
                    SysexCommands.PIN_STATE_QUERY,
                    86,
                    MessageConstants.SYSEX_END
                };

            var message = new PinStateQueryMessage {Pin = 86};
            var creator = new PinStateQueryMessageCreator();
            var newBytes = creator.CreateMessage(message);
            Assert.AreEqual(bytes,newBytes);
        }
Ejemplo n.º 3
0
        public override void Creates_Appropriate_Message()
        {
            var bytes = new byte[]
            {
                MessageConstants.SYSEX_START,
                SysexCommands.PIN_STATE_QUERY,
                86,
                MessageConstants.SYSEX_END
            };

            var message = new PinStateQueryMessage {
                Pin = 86
            };
            var creator  = new PinStateQueryMessageCreator();
            var newBytes = creator.CreateMessage(message);

            Assert.AreEqual(bytes, newBytes);
        }
 public void Throws_Error_On_Wrong_Pin()
 {
     var creator = new PinStateQueryMessageCreator();
     Assert.Throws<MessageCreatorException>(() => creator.CreateMessage(new PinStateQueryMessage{Pin = 130}));
 }
 public override void Throws_Error_On_Wrong_Message()
 {
     var creator = new PinStateQueryMessageCreator();
     Assert.Throws<MessageCreatorException>(() => creator.CreateMessage(new AnalogMessage()));
 }
Ejemplo n.º 6
0
        public override void Throws_Error_On_Wrong_Message()
        {
            var creator = new PinStateQueryMessageCreator();

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