Example #1
0
        public void Throws_Error_On_Wrong_Port()
        {
            var creator = new ToggleDigitalReportMessageCreator();

            Assert.Throws <MessageCreatorException>(() => creator.CreateMessage(new ToggleDigitalReportMessage {
                Port = 17
            }));
        }
        public void Creates_Appropriate_Message_Off()
        {
            var creator = new ToggleDigitalReportMessageCreator();
            var bytes = creator.CreateMessage(new ToggleDigitalReportMessage { Port = 4, ShouldBeEnabled = false });

            Assert.AreEqual(bytes[0], MessageConstants.REPORT_DIGITAL_PORT | 4);
            Assert.AreEqual(bytes[1], 0);
        }
Example #3
0
        public void Creates_Appropriate_Message_Off()
        {
            var creator = new ToggleDigitalReportMessageCreator();
            var bytes   = creator.CreateMessage(new ToggleDigitalReportMessage {
                Port = 4, ShouldBeEnabled = false
            });

            Assert.AreEqual(bytes[0], MessageConstants.REPORT_DIGITAL_PORT | 4);
            Assert.AreEqual(bytes[1], 0);
        }
Example #4
0
        public override void Throws_Error_On_Wrong_Message()
        {
            var creator = new ToggleDigitalReportMessageCreator();

            Assert.Throws <MessageCreatorException>(() => creator.CreateMessage(new AnalogMessage()));
        }
 public void Throws_Error_On_Wrong_Port()
 {
     var creator = new ToggleDigitalReportMessageCreator();
     Assert.Throws<MessageCreatorException>(() => creator.CreateMessage(new ToggleDigitalReportMessage {Port = 17}));
 }
 public override void Throws_Error_On_Wrong_Message()
 {
     var creator = new ToggleDigitalReportMessageCreator();
     Assert.Throws<MessageCreatorException>(() =>creator.CreateMessage(new AnalogMessage()));
 }