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
// ****************************************************************
10
import NUnit.Framework.Assert;
12
/** @attribute NUnit.Framework.TestFixture() */
13
public class SimpleJSharpTest
15
protected int fValue1;
16
protected int fValue2;
18
/** @attribute NUnit.Framework.SetUp() */
25
/** @attribute NUnit.Framework.Test() */
28
int result= fValue1 + fValue2;
29
Assert.AreEqual(6,result, "Expected Failure");
32
/** @attribute NUnit.Framework.Test() */
33
public void DivideByZero()
37
KeepCompilerFromWarning(result); // never executed, here to avoid compiler warning that result is unused.
40
/** @attribute NUnit.Framework.Test() */
43
Assert.AreEqual(12, 12, "Integer");
44
Assert.AreEqual(new Long(12), new Long(13), "Long");
45
Assert.AreEqual('a', 'a', "Char");
46
Assert.AreEqual(new Integer(12), new Integer(12), "Integer Object Cast");
48
Assert.AreEqual(12, 13, "Expected Failure (Integer)");
49
Assert.AreEqual(12.0, 11.99, 0.0, "Expected Failure (Double).");
52
/** @attribute NUnit.Framework.Test() */
53
/** @attribute NUnit.Framework.Ignore("ignored test") */
54
public void IgnoredTest()
56
throw new InvalidCastException();
59
// A useless function, designed to avoid a compiler warning in the the DivideByZero test.
60
private int KeepCompilerFromWarning(int dummy)
b'\\ No newline at end of file'