Beispiel #1
0
        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;
        }
Beispiel #2
0
        public void GetPorts_ReturnsList_NotNullOrEmpty()
        {
            var ports = PortParser.GetPorts();

            ports.Should().NotBeNullOrEmpty();
        }
Beispiel #3
0
        public void GetPorts_ReturnsList_ValidType()
        {
            var ports = PortParser.GetPorts();

            ports.Should().BeOfType <List <KeyValuePair <string, SerialPort> > >();
        }
Beispiel #4
0
        public void GetPorts_NoException()
        {
            Action result = () => PortParser.GetPorts();

            result.Should().NotThrow <Exception>();
        }