コード例 #1
0
 public void GivenDevice_WhenCreateDeviceWithUnknownPartialId_ThenDeviceIsNotEnabled()
 {
     using (var device = new Rs232Device("invalid"))
     {
         Assert.IsFalse(device.Enabled);
     }
 }
コード例 #2
0
        private static Rs232Device CreateDevice()
        {
            var device = new Rs232Device(_settings["Devices"]["SerialBlaster"][0]["portId"].ToString());

            device.BaudRate = 115200;
            device.PreWrite = (x) =>
            {
                return(x + "\r");
            };

            return(device);
        }
コード例 #3
0
 public void GivenNullPartialId_WhenNewDevice_ThenArgumentExceptionThrown()
 {
     using (var rs232Device = new Rs232Device(null))
     {
     }
 }
コード例 #4
0
 public void GivenEmptyPartialId_WhenNewDevice_ThenArgumentExceptionThrown()
 {
     using (var rs232Device = new Rs232Device(string.Empty))
     {
     }
 }