5 // Atsushi Enomoto <atsushi@ximian.com>
7 // (C) 2006 Novell, Inc.
13 namespace MonoTests.System.Text
16 public class DecoderTest
20 [ExpectedException (typeof (ArgumentNullException))]
21 public void ConvertNullChars ()
23 int charsUsed, bytesUsed;
25 Encoding.UTF8.GetDecoder ().Convert (
26 null, 0, 100, new char [100], 0, 100, false,
27 out charsUsed, out bytesUsed, out done);
31 [ExpectedException (typeof (ArgumentNullException))]
32 public void ConvertNullBytes ()
34 int charsUsed, bytesUsed;
36 Encoding.UTF8.GetDecoder ().Convert (
37 new byte [100], 0, 100, null, 0, 100, false,
38 out charsUsed, out bytesUsed, out done);
42 public void ConvertLimitedDestination ()
44 char [] chars = new char [10000];
45 byte [] bytes = new byte [10000];
47 Decoder conv = Encoding.UTF8.GetDecoder ();
48 int charsUsed, bytesUsed;
51 conv.Convert (bytes, 0, 10000, chars, 0, 1000, true,
52 out charsUsed, out bytesUsed, out done);
54 Assert.IsFalse (done, "#1");
55 Assert.AreEqual (625, charsUsed, "#2");
56 Assert.AreEqual (625, bytesUsed, "#3");