Пример #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;
        }
Пример #2
0
        public void GetPorts_ReturnsList_NotNullOrEmpty()
        {
            var ports = PortParser.GetPorts();

            ports.Should().NotBeNullOrEmpty();
        }
Пример #3
0
        public void GetPorts_ReturnsList_ValidType()
        {
            var ports = PortParser.GetPorts();

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

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