public void CreateWriteMultipleCoilsRequestMaxSize()
        {
            WriteMultipleCoilsRequest request = new WriteMultipleCoilsRequest(1, 2,
                                                                              MessageUtility.CreateDefaultCollection <DiscreteCollection, bool>(true, Modbus.MaximumDiscreteRequestResponseSize));

            Assert.Equal(Modbus.MaximumDiscreteRequestResponseSize, request.Data.Count);
        }
        public void CreateWriteMultipleRegistersRequestMaxSize()
        {
            WriteMultipleRegistersRequest request = new WriteMultipleRegistersRequest(1, 2,
                                                                                      MessageUtility.CreateDefaultCollection <RegisterCollection, ushort>(3, Modbus.MaximumRegisterRequestResponseSize));

            Assert.Equal(Modbus.MaximumRegisterRequestResponseSize, request.NumberOfPoints);
        }
 public void CreateWriteMultipleRegistersRequestTooMuchData()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                 new WriteMultipleRegistersRequest(1, 2,
                                                                                   MessageUtility.CreateDefaultCollection <RegisterCollection, ushort>(3, Modbus.MaximumRegisterRequestResponseSize + 1)));
 }
 public void CreateWriteMultipleCoilsRequestTooMuchData()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                 new WriteMultipleCoilsRequest(1, 2, MessageUtility.CreateDefaultCollection <DiscreteCollection, bool>(true, Modbus.MaximumDiscreteRequestResponseSize + 1)));
 }