Ejemplo n.º 1
0
        public void Communication_PortSelectorTest_TestDynamicPort()
        {
            testPorts = new List <string>();
            testPorts.Add("COM0");
            testPorts.Add("COM1");
            testPorts.Add("COM2");
            var selector = new PortSelector(GetTestPorts);

            Assert.AreEqual("COM0", selector.Next());
            Assert.AreEqual("COM1", selector.Next());
            Assert.AreEqual("COM2", selector.Next());
            Assert.AreEqual("COM0", selector.Next());
            testPorts.Add("COM3");

            Assert.AreEqual("COM1", selector.Next());
            Assert.AreEqual("COM2", selector.Next());
            Assert.AreEqual("COM3", selector.Next());
            Assert.AreEqual("COM0", selector.Next());

            testPorts.Remove("COM1");
            Assert.AreEqual("COM2", selector.Next());
            Assert.AreEqual("COM3", selector.Next());
            Assert.AreEqual("COM0", selector.Next());
            Assert.AreEqual("COM2", selector.Next());
            Assert.AreEqual("COM3", selector.Next());
            Assert.AreEqual("COM0", selector.Next());
            Assert.AreEqual("COM2", selector.Next());

            testPorts = new List <string>();
            Assert.IsNull(selector.Next());
        }
Ejemplo n.º 2
0
        public void Communication_PortSelectorTest_TestNoPortsAvailable()
        {
            testPorts = new List <string>();
            var selector = new PortSelector(GetTestPorts);

            Assert.IsNull(selector.Next());
        }
Ejemplo n.º 3
0
        public void Communication_PortSelectorTest_TestStaticScenario()
        {
            testPorts = new List <string>();
            testPorts.Add("COM0");
            testPorts.Add("COM1");
            testPorts.Add("COM2");
            var selector = new PortSelector(GetTestPorts);

            Assert.AreEqual("COM0", selector.Next());
            Assert.AreEqual("COM1", selector.Next());
            Assert.AreEqual("COM2", selector.Next());
            Assert.AreEqual("COM0", selector.Next());
        }
Ejemplo n.º 4
0
        public TrackInfo(Track track)
        {
            InitializeComponent();

            _track = track;

            Deselect();

            Rename = new RenameManager(this);

            Rename.UpdateText();
            _track.ParentIndexChanged += UpdateText;

            PortSelector.Update(_track.Launchpad);

            DragDrop = new DragDropManager(this);

            SetEnabled();
        }
Ejemplo n.º 5
0
 public void Communication_PortSelectorTest_TestObjectCreationWithRealEnumerator()
 {
     var manager = new PortSelector(SerialPort.GetPortNames);
 }