SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 44 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

"Model-Based Software Testing and Analysis with C#"

NUnit also provides test runner applications that execute the tests and
report the results.
1 There are many options for locating libraries: they can be in the same directory as the application,
or in a special .NET directory called the Global Assembly Cache (GAC), or in a directory
identified by one of the .NET .config files.
2 Some editions of Microsoft Visual Studio include a similar unit testing tool.
24 Why We Need Model-Based Testing
using System;
using NUnit.Framework;
namespace ClientServerImpl
{
// Test fixture for remote instrument Server, Client, Temperature classes
[TestFixture]
public class Tests
{
#region [SetUp], [TearDown] methods (code not shown)
// Check Fahrenheit to Celsius conversion, one data point
[Test]
[Category("Convert")]
public void Convert32()
{
Assert.AreEqual(Temperature.ConvertToCelsius(32), 0);
}
// Check Fahrenheit to Celsius conversion, several data points
[Test]
[Category("Convert")]
public void ConvertMany()
{
Assert.AreEqual(Temperature.ConvertToCelsius(32), 0);
Assert.AreEqual(Temperature.ConvertToCelsius(98.6), 37);
Assert.AreEqual(Temperature.ConvertToCelsius(212), 100);
Assert.AreEqual(Temperature.ConvertToCelsius(212), 101); //Fail!
}
#region Other tests (code not shown)
}
}
Figure 2.9. Test fixture with test methods.
To write unit tests for NUnit, code a test fixture class that has test methods.


Pages:
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6