Example #1
0
        public void Throws_Error_On_Wrong_Pin()
        {
            var creator = new PinModeMessageCreator();

            Assert.Throws <MessageCreatorException>(() => creator.CreateMessage(new PinModeMessage {
                Mode = PinModes.Analog, Pin = 244
            }));
        }
        public override void Creates_Appropriate_Message()
        {
            var creator = new PinModeMessageCreator();
            var bytes = creator.CreateMessage(new PinModeMessage {Mode = PinModes.Analog, Pin = 4});

            Assert.AreEqual(bytes[0],MessageConstants.SET_PIN_MODE);
            Assert.AreEqual(bytes[1],4);
            Assert.AreEqual(bytes[2],(byte)PinModes.Analog);
        }
Example #3
0
        public override void Creates_Appropriate_Message()
        {
            var creator = new PinModeMessageCreator();
            var bytes   = creator.CreateMessage(new PinModeMessage {
                Mode = PinModes.Analog, Pin = 4
            });

            Assert.AreEqual(bytes[0], MessageConstants.SET_PIN_MODE);
            Assert.AreEqual(bytes[1], 4);
            Assert.AreEqual(bytes[2], (byte)PinModes.Analog);
        }
 public void Throws_Error_On_Wrong_Pin()
 {
     var creator = new PinModeMessageCreator();
     Assert.Throws<MessageCreatorException>(() => creator.CreateMessage(new PinModeMessage { Mode = PinModes.Analog, Pin = 244 }));
 }
 public override void Throws_Error_On_Wrong_Message()
 {
     var creator = new PinModeMessageCreator();
     Assert.Throws<MessageCreatorException>(() => creator.CreateMessage(new AnalogMessage()));
 }
Example #6
0
        public override void Throws_Error_On_Wrong_Message()
        {
            var creator = new PinModeMessageCreator();

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