Exemplo n.º 1
0
        public void Equals_implementation(int code, string smile)
        {
            UnicodeString unicode = FacePositive.Grinning;

            Assert.True(unicode.Equals(code));
            Assert.True(unicode.Equals(smile));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Equalses the specified o.
 /// </summary>
 /// <param name="o">The o.</param>
 /// <returns></returns>
 public override bool Equals(Object o)
 {
     if (o is HSSFRichTextString)
     {
         return(_string.Equals(((HSSFRichTextString)o).String));
     }
     return(false);
 }
Exemplo n.º 3
0
        public void TestSimpleAddString()
        {
            SSTRecord     record = new SSTRecord();
            UnicodeString s1     = new UnicodeString("Hello world");

            // \u2122 is1 the encoding of the trademark symbol ...
            UnicodeString s2 = new UnicodeString("Hello world\u2122");

            Assert.AreEqual(0, record.AddString(s1));
            Assert.AreEqual(s1, record.GetString(0));
            Assert.AreEqual(1, record.CountStrings);
            Assert.AreEqual(1, record.NumStrings);
            Assert.AreEqual(1, record.NumUniqueStrings);
            Assert.AreEqual(0, record.AddString(s1));
            Assert.AreEqual(s1, record.GetString(0));
            Assert.AreEqual(1, record.CountStrings);
            Assert.AreEqual(2, record.NumStrings);
            Assert.AreEqual(1, record.NumUniqueStrings);
            Assert.AreEqual(1, record.AddString(s2));
            Assert.AreEqual(s2, record.GetString(1));
            Assert.AreEqual(2, record.CountStrings);
            Assert.AreEqual(3, record.NumStrings);
            Assert.AreEqual(2, record.NumUniqueStrings);
            System.Collections.IEnumerator iter = record.GetStrings();

            while (iter.MoveNext())
            {
                UnicodeString ucs = (UnicodeString)iter.Current;

                if (ucs.Equals(s1))
                {
                    Assert.AreEqual((byte)0, ucs.OptionFlags);
                }
                else if (ucs.Equals(s2))
                {
                    Assert.AreEqual((byte)1, ucs.OptionFlags);
                }
                else
                {
                    Assert.Fail("cannot match string: " + ucs.String);
                }
            }
        }