Ver código fonte

2002-02-09 Nick Drochak <[email protected]>

	* StringBuilderTest.cs: Fixed tests that were failing against mscorlib.

svn path=/trunk/mcs/; revision=2279
Nick Drochak 24 anos atrás
pai
commit
6c4cbb676f

+ 3 - 0
mcs/class/corlib/Test/System.Text/ChangeLog

@@ -0,0 +1,3 @@
+2002-02-09  Nick Drochak  <[email protected]>
+
+	* StringBuilderTest.cs: Fixed tests that were failing against mscorlib. 

+ 4 - 11
mcs/class/corlib/Test/System.Text/StringBuilderTest.cs

@@ -54,7 +54,7 @@ public class StringBuilderTest : TestCase {
 			AssertEquals(String.Empty, sb.ToString());
 			AssertEquals(0, sb.Length);
 			// check that capacity is not less than default
-			AssertEquals(16, sb.Capacity);
+			AssertEquals(10, sb.Capacity);
 
 			sb = new StringBuilder(42);
 			AssertEquals(String.Empty, sb.ToString());
@@ -86,16 +86,9 @@ public class StringBuilderTest : TestCase {
 		}
 
 	public void TestConstructor5() {
-		// check for exception in ctor that prevents null 'value'
-		try {
-			String someString = null;
-			sb = new StringBuilder(someString);
-		}
-		catch (ArgumentNullException) {
-			return;
-		}
-		// if we didn't catch an exception, then we have a problem Houston.
-		NUnit.Framework.Assertion.Fail("Value not allowed to be null.");
+		String someString = null;
+		sb = new StringBuilder(someString);
+		AssertEquals("Should be empty string", String.Empty, sb.ToString());
 	}
 
 	public void TestConstructor6() {