public void ParsePort_COM1_Returns1() { int result = SerialPortParser.ParsePort("COM1"); Assert.That(result, Is.EqualTo(1)); //older style //Asserts.AreEqual(1, result); }
public void ParsePort_COM1_Returns1() { //Act int result = SerialPortParser.ParsePort("COM1"); //Assert Assert.That(result, Is.EqualTo(1)); // Contraint Assert Model Nunit // Assert.AreEqual(1, result);//Klassieke Assert Model NUnit }
public void ParsePort_CCOM1_Returns1() { int result = SerialPortParser.ParsePort("COM1"); Assert.That(result, Is.EqualTo(1)); //Assert is the class from NUnit //Lots of methods like That, Is, Throws, etc. //result is the actual result //second part is what we expect }
public void ParsePort_InvalidFormat_ThrowsInvalidFormatException() { TestDelegate action = () => SerialPortParser.ParsePort("1"); Assert.Throws <FormatException>(action); }
public void ParsePort_COM1_Returns1() { int result = SerialPortParser.ParsePort("COM1"); Assert.That(result, Is.EqualTo(1)); }