Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jordan <robertj@gmx.net>2009-06-26 16:34:15 +0400
committerRobert Jordan <robertj@gmx.net>2009-06-26 16:34:15 +0400
commitd7a6be82515684170ec69cf3b62be984053d2cff (patch)
tree98146cbcec1413be2c972be57eaf086e6c429eda /mcs/class/System/Test
parent5f94e5e16c2640dd5e76687806e173badc60ae72 (diff)
2009-06-26 Robert Jordan <robertj@gmx.net>
* SwitchesTest.cs, TraceTest.cs: Upgrade to new NUnit style. svn path=/trunk/mcs/; revision=136951
Diffstat (limited to 'mcs/class/System/Test')
-rw-r--r--mcs/class/System/Test/System.Diagnostics/ChangeLog4
-rw-r--r--mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs38
-rw-r--r--mcs/class/System/Test/System.Diagnostics/TraceTest.cs20
3 files changed, 33 insertions, 29 deletions
diff --git a/mcs/class/System/Test/System.Diagnostics/ChangeLog b/mcs/class/System/Test/System.Diagnostics/ChangeLog
index 8a05f4a1a52..2a5e3c7a03b 100644
--- a/mcs/class/System/Test/System.Diagnostics/ChangeLog
+++ b/mcs/class/System/Test/System.Diagnostics/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-26 Robert Jordan <robertj@gmx.net>
+
+ * SwitchesTest.cs, TraceTest.cs: Upgrade to new NUnit style.
+
2009-02-24 Andrés G. Aragoneses <aaragoneses@novell.com>
* Process.cs: New tests for bug 477943.
diff --git a/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs b/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs
index a9813ade91d..dc82f1fa2ed 100644
--- a/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs
+++ b/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs
@@ -79,7 +79,7 @@ namespace MonoTests.System.Diagnostics {
}
[TestFixture]
- public class SwitchesTest : Assertion {
+ public class SwitchesTest {
private static BooleanSwitch bon = new BooleanSwitch ("bool-true", "");
private static BooleanSwitch bon2 = new BooleanSwitch ("bool-true-2", "");
@@ -101,11 +101,11 @@ namespace MonoTests.System.Diagnostics {
[Test]
public void BooleanSwitches ()
{
- Assert ("#BS:T:1", bon.Enabled);
- Assert ("#BS:T:2", bon2.Enabled);
- Assert ("#BS:T:3", bon3.Enabled);
- Assert ("#BS:F:1", !boff.Enabled);
- Assert ("#BS:F:2", !boff2.Enabled);
+ Assert.IsTrue (bon.Enabled, "#BS:T:1");
+ Assert.IsTrue (bon2.Enabled, "#BS:T:2");
+ Assert.IsTrue (bon3.Enabled, "#BS:T:3");
+ Assert.IsTrue (!boff.Enabled, "#BS:F:1");
+ Assert.IsTrue (!boff2.Enabled, "#BS:F:2");
}
[Test]
@@ -131,10 +131,10 @@ namespace MonoTests.System.Diagnostics {
private void CheckTraceSwitch (TraceSwitch ts, bool te, bool tw, bool ti, bool tv)
{
string desc = string.Format ("#TS:{0}", ts.DisplayName);
- AssertEquals (desc + ":TraceError", te, ts.TraceError);
- AssertEquals (desc + ":TraceWarning", tw, ts.TraceWarning);
- AssertEquals (desc + ":TraceInfo", ti, ts.TraceInfo);
- AssertEquals (desc + ":TraceVerbose", tv, ts.TraceVerbose);
+ Assert.AreEqual (te, ts.TraceError, desc + ":TraceError");
+ Assert.AreEqual (tw, ts.TraceWarning, desc + ":TraceWarning");
+ Assert.AreEqual (ti, ts.TraceInfo, desc + ":TraceInfo");
+ Assert.AreEqual (tv, ts.TraceVerbose, desc + ":TraceVerbose");
}
[Test]
@@ -143,15 +143,15 @@ namespace MonoTests.System.Diagnostics {
#endif
public void NewSwitch ()
{
- AssertEquals ("#NS:TestValue", "42", tns.TestValue);
- Assert ("#NS:Validate", tns.Validate());
+ Assert.AreEqual ("42", tns.TestValue, "#NS:TestValue");
+ Assert.IsTrue (tns.Validate(), "#NS:Validate");
}
#if NET_2_0
[Test]
public void GetSupportedAttributes ()
{
- AssertNull (tns.ExposeSupportedAttributes ());
+ Assert.IsNull (tns.ExposeSupportedAttributes ());
}
[Test] // no ArgumentNullException happens...
@@ -164,15 +164,15 @@ namespace MonoTests.System.Diagnostics {
public void BooleanSwitchValidDefaultValue ()
{
BooleanSwitch s = new BooleanSwitch ("test", "", "2");
- Assert ("#1", s.Enabled);
+ Assert.IsTrue (s.Enabled, "#1");
s = new BooleanSwitch ("test", "", "0");
- Assert ("#2", !s.Enabled);
+ Assert.IsTrue (!s.Enabled, "#2");
s = new BooleanSwitch ("test", "", "true");
- Assert ("#3", s.Enabled);
+ Assert.IsTrue (s.Enabled, "#3");
s = new BooleanSwitch ("test", "", "True");
- Assert ("#4", s.Enabled);
+ Assert.IsTrue (s.Enabled, "#4");
s = new BooleanSwitch ("test", "", "truE");
- Assert ("#5", s.Enabled);
+ Assert.IsTrue (s.Enabled, "#5");
}
[Test]
@@ -180,7 +180,7 @@ namespace MonoTests.System.Diagnostics {
public void BooleanSwitchInvalidDefaultValue ()
{
BooleanSwitch s = new BooleanSwitch ("test", "", "hoge");
- Assert (!s.Enabled);
+ Assert.IsTrue (!s.Enabled);
}
#endif
}
diff --git a/mcs/class/System/Test/System.Diagnostics/TraceTest.cs b/mcs/class/System/Test/System.Diagnostics/TraceTest.cs
index 1491a6a897a..25354a19ee5 100644
--- a/mcs/class/System/Test/System.Diagnostics/TraceTest.cs
+++ b/mcs/class/System/Test/System.Diagnostics/TraceTest.cs
@@ -61,7 +61,7 @@ namespace MonoTests.System.Diagnostics {
Trace.WriteLine ("Entering Main");
Trace.WriteLine ("Exiting Main");
- Assertion.AssertEquals ("#Tr01", value, buffer.ToString ());
+ Assert.AreEqual (value, buffer.ToString (), "#Tr01");
}
// Make sure we get the output we expect in the presence of indenting...
@@ -79,14 +79,14 @@ namespace MonoTests.System.Diagnostics {
Trace.WriteLine ("List of errors:");
Trace.Indent ();
- Assertion.AssertEquals (1, Trace.IndentLevel);
+ Assert.AreEqual (1, Trace.IndentLevel);
Trace.WriteLine ("Error 1: File not found");
Trace.WriteLine ("Error 2: Directory not found");
Trace.Unindent ();
- Assertion.AssertEquals (0, Trace.IndentLevel);
+ Assert.AreEqual (0, Trace.IndentLevel);
Trace.WriteLine ("End of list of errors");
- Assertion.AssertEquals ("#In01", value, buffer.ToString());
+ Assert.AreEqual (value, buffer.ToString(), "#In01");
}
// Make sure that TraceListener properties (IndentLevel, IndentSize) are
@@ -108,8 +108,8 @@ namespace MonoTests.System.Diagnostics {
foreach (TraceListener t in Trace.Listeners) {
string ids = "#TATLP-S-" + t.Name;
string idl = "#TATLP-L-" + t.Name;
- Assertion.AssertEquals (ids, ExpectedSize, t.IndentSize);
- Assertion.AssertEquals (idl, ExpectedLevel, t.IndentLevel);
+ Assert.AreEqual (ExpectedSize, t.IndentSize, ids);
+ Assert.AreEqual (ExpectedLevel, t.IndentLevel, idl);
}
Trace.Listeners.Remove(t1);
@@ -135,16 +135,16 @@ namespace MonoTests.System.Diagnostics {
// Assertion.Assert that the listener we added has been set to the correct indent
// level.
- Assertion.AssertEquals ("#LATL-L", ExpectedLevel, tl.IndentLevel);
- Assertion.AssertEquals ("#LATL-S", ExpectedSize, tl.IndentSize);
+ Assert.AreEqual (ExpectedLevel, tl.IndentLevel, "#LATL-L");
+ Assert.AreEqual (ExpectedSize, tl.IndentSize, "#LATL-S");
// Assertion.Assert that all listeners in the collection have the same level.
foreach (TraceListener t in Trace.Listeners)
{
string idl = "#LATL-L:" + t.Name;
string ids = "#LATL-S:" + t.Name;
- Assertion.AssertEquals(idl, ExpectedLevel, t.IndentLevel);
- Assertion.AssertEquals(ids, ExpectedSize, t.IndentSize);
+ Assert.AreEqual (ExpectedLevel, t.IndentLevel, idl);
+ Assert.AreEqual (ExpectedSize, t.IndentSize, ids);
}
}