public void Test_equalsLjava_lang_Object()
 {
     // Test for method boolean
     // java.text.IBM.ICU.Text.MessageFormat.equals(java.lang.Object)
     IBM.ICU.Text.MessageFormat format1_0 = new IBM.ICU.Text.MessageFormat("{0}");
     IBM.ICU.Text.MessageFormat format2_1 = new IBM.ICU.Text.MessageFormat("{1}");
     NUnit.Framework.Assert.IsTrue(!format1_0.Equals(format2_1), "Should not be equal");
     format2_1.ApplyPattern("{0}");
     NUnit.Framework.Assert.IsTrue(format1_0.Equals(format2_1), "Should be equal");
     IBM.ICU.Text.SimpleDateFormat date = (IBM.ICU.Text.SimpleDateFormat)IBM.ICU.Text.DateFormat.GetTimeInstance();
     format1_0.SetFormat(0, IBM.ICU.Text.DateFormat.GetTimeInstance());
     format2_1.SetFormat(0, new IBM.ICU.Text.SimpleDateFormat(date.ToPattern()));
     NUnit.Framework.Assert.IsTrue(format1_0.Equals(format2_1), "Should be equal2");
 }
 public void Test_clone()
 {
     // Test for method java.lang.Object java.text.IBM.ICU.Text.MessageFormat.clone()
     IBM.ICU.Text.MessageFormat format = new IBM.ICU.Text.MessageFormat("'{'choice'}'{0}");
     IBM.ICU.Text.MessageFormat clone  = (IBM.ICU.Text.MessageFormat)format.Clone();
     NUnit.Framework.Assert.IsTrue(format.Equals(clone), "Clone not equal");
     NUnit.Framework.Assert.AreEqual("{choice}{0}", format.FormatObject(new Object[] { }), "Wrong answer");
     clone.SetFormat(0, IBM.ICU.Text.DateFormat.GetInstance());
     NUnit.Framework.Assert.IsTrue(!format.Equals(clone), "Clone shares format data");
     format = (IBM.ICU.Text.MessageFormat)clone.Clone();
     Format[] formats = clone.GetFormats();
     ((IBM.ICU.Text.SimpleDateFormat)formats[0]).ApplyPattern("adk123");
     NUnit.Framework.Assert.IsTrue(!format.Equals(clone), "Clone shares format data");
 }
 private void CheckSerialization(IBM.ICU.Text.MessageFormat format)
 {
     try
     {
         MemoryStream         ba   = new MemoryStream();
         IlObjectOutputStream xout = new IlObjectOutputStream(ba);
         xout.WriteObject(format);
         ((Stream)xout).Close();
         IlObjectInputStream ins0 = new IlObjectInputStream(
             new MemoryStream(ba.ToArray()));
         IBM.ICU.Text.MessageFormat read = (IBM.ICU.Text.MessageFormat)ins0.ReadObject();
         NUnit.Framework.Assert.IsTrue(format.Equals(read), "Not equal: " + format.ToPattern());
     }
     catch (IOException e)
     {
         NUnit.Framework.Assert.Fail("Format: " + format.ToPattern() + " caused IOException: " + e);
     }
     catch (TypeLoadException e_0)
     {
         NUnit.Framework.Assert.Fail("Format: " + format.ToPattern()
                                     + " caused ClassNotFoundException: " + e_0);
     }
 }