Пример #1
0
        public void ParsePort_COM1_Returns1()
        {
            int result = SerialPortParser.ParsePort("COM1");

            Assert.That(result, Is.EqualTo(1));

            //older style of Asserts in NUnit
            //Assert.AreEqual(1, result);
        }
Пример #2
0
        public void ParsePort_InvalidFormat_ThrowsInvalidFormatException()
        {
            TestDelegate action = () => SerialPortParser.ParsePort("1");

            Assert.Throws <FormatException>(action);
        }