1
// ****************************************************************
2
// This is free software licensed under the NUnit license. You
3
// may obtain a copy of the license as well as information regarding
4
// copyright ownership at http://nunit.org/?p=license&r=2.4.
5
// ****************************************************************
9
namespace NUnitSamples {
11
void SimpleCPPSample::Init() {
16
void SimpleCPPSample::Add() {
17
int result = fValue1 + fValue2;
18
Assert::AreEqual(6,result);
21
void SimpleCPPSample::DivideByZero()
27
void SimpleCPPSample::Equals() {
28
Assert::AreEqual(12, 12, "Integer");
29
Assert::AreEqual(12L, 12L, "Long");
30
Assert::AreEqual('a', 'a', "Char");
33
Assert::AreEqual(12, 13, "Expected Failure (Integer)");
34
Assert::AreEqual(12.0, 11.99, 0.0, "Expected Failure (Double)");
37
void SimpleCPPSample::IgnoredTest()
39
throw gcnew InvalidCastException();
42
void SimpleCPPSample::ExpectAnException()
44
throw gcnew InvalidCastException();