示例#1
0
 public void AppendString()
 {
     using (var s = new CFMutableString()) {
         Assert.Throws <ArgumentNullException> (() => s.Append((string)null), "null");
         // from NSHipster
         s.Append("Énġlišh långuãge lẳcks iñterêßţing diaçrïtičş!");
         Assert.That(s.Handle, Is.Not.EqualTo(IntPtr.Zero), "Handle");
         Assert.That(s.ToString(), Is.EqualTo("Énġlišh långuãge lẳcks iñterêßţing diaçrïtičş!"), "ToString");
     }
 }
示例#2
0
 public void AppendString_RtL()
 {
     using (var s = new CFMutableString()) {
         s.Append("שלום");
         Assert.That(s.Handle, Is.Not.EqualTo(IntPtr.Zero), "Handle");
         Assert.That(s.ToString(), Is.EqualTo("שלום"), "ToString");
     }
 }
示例#3
0
 public void AppendString_Unicode()
 {
     using (var s = new CFMutableString("Bonjour")) {
         s.Append(" à tous les \ud83d\udc11!");
         Assert.That(s.Handle, Is.Not.EqualTo(IntPtr.Zero), "Handle");
         // make it fail and you see the sheep printed in the touchunit runner UI :)
         Assert.That(s.ToString(), Is.EqualTo("Bonjour à tous les \ud83d\udc11!"), "ToString");
     }
 }