27.07.2013 Views

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Overview 43<br />

Included categories: OutOfRangeMessage<br />

.?Timeout, Timeout, Error<br />

Reset<br />

?Message ’99.9’, Message, Error<br />

CheckMessage ’99.9’, compare to 99.9, OK<br />

?Timeout, Timeout, OK<br />

Poll<br />

?Message ’999.9’, Message, OK<br />

CheckMessage ’999.9’, compare to 99.9, Error<br />

?Command, Timeout, Error<br />

?Timeout, Timeout, Error<br />

Reset<br />

?Message ’100.1’, Message, Error<br />

CheckMessage ’100.1’, compare to 99.9, OK<br />

?Timeout, Timeout, OK<br />

Poll<br />

?Message ’101.5’, Message, OK<br />

CheckMessage ’101.5’, compare to 100.1, OK<br />

?Command, Timeout, OK<br />

Calibrate ’101.5’<br />

?Exit, Timeout, OK<br />

Did the expected handlers run? [y/n] y<br />

Tests run: 1, Failures: 0, Not run: 0, Time: 7.440 seconds<br />

<strong>We</strong> write another test method to check that the controller reports a lost message.<br />

This test succeeds as well. After a Timeout event follows the Poll handler, the<br />

ReportLostMessage handler runs. The sensor status remains OK, so the controller<br />

still carries out the calibrate command.<br />

>nunit-console /include=LostMessage Tests.dll<br />

...<br />

Included categories: LostMessage<br />

.?Timeout, Timeout, Error<br />

Reset<br />

?Message ’99.9’, Message, Error<br />

CheckMessage ’99.9’, compare to 99.9, OK<br />

?Timeout, Timeout, OK<br />

Poll<br />

more free ebooks download links at:<br />

http://www.ebook-x.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!