private void InitializeDevices() { var portslist = new List <KeyValuePair <string, SerialPort> >(); portslist.Add(new KeyValuePair <string, SerialPort>("Select Device...", null)); portslist.AddRange(PortParser.GetPorts()); cbDevice.ItemsSource = portslist; cbDevice.SelectionChanged += CbDevice_SelectionChanged; }
public void GetPorts_ReturnsList_NotNullOrEmpty() { var ports = PortParser.GetPorts(); ports.Should().NotBeNullOrEmpty(); }
public void GetPorts_ReturnsList_ValidType() { var ports = PortParser.GetPorts(); ports.Should().BeOfType <List <KeyValuePair <string, SerialPort> > >(); }
public void GetPorts_NoException() { Action result = () => PortParser.GetPorts(); result.Should().NotThrow <Exception>(); }