public void TestNotFoundPort()
        {
            var collection = new VideoPortsCollection(new VideoPort[0]);

            // act
            VideoPort found;
            var result = VideoPortsCollectionExtensions.TryGetPort(collection, "test", out found);

            // assert
            Assert.IsFalse(result);
        }
        public void PortIsFoundTest()
        {
            var port = new VideoPort { Name = "HDMI" };
            var port1 = new VideoPort { Name = "DVI" };
            var port2 = new VideoPort { Name = "VGA" };
            var collection = new VideoPortsCollection(new[] { port, port1, port2 });

            VideoPort found;
            var result = collection.TryGetPort(port1.Name, out found);

            Assert.IsTrue(result);
            Assert.AreEqual(port1, found);
        }
Example #3
0
 /// <summary>
 /// More customized constructor
 /// </summary>
 /// <param name="model"></param>
 /// <param name="videoPorts"></param>
 public Gadget(string model, VideoPort[] videoPorts, string serial = "000-00-00")
 {
     _videoPorts = new VideoPortsCollection(videoPorts);
     _model = model;
     _serial = serial;
 }