public void TestSelectorExtensions()
{
ObjectiveCRuntime.Initialize();
String name, name1, name2;
IntPtr sel1, sel2;
name = "alloc";
sel1 = ObjectiveCRuntime.Selector(name);
Assert.AreNotEqual(IntPtr.Zero, sel1, "Selector cannot be null");
sel2 = name.ToSelector();
Assert.AreNotEqual(IntPtr.Zero, sel2, "Selector cannot be null");
name1 = ObjectiveCRuntime.Selector(sel1);
Assert.AreEqual(name, name1, "Selector must be equal");
name2 = ObjectiveCRuntime.Selector(sel2);
Assert.AreEqual(name, name2, "Selector must be equal");
name = "isEqualToValue:";
sel1 = ObjectiveCRuntime.Selector(name);
Assert.AreNotEqual(IntPtr.Zero, sel1, "Selector cannot be null");
sel2 = name.ToSelector();
Assert.AreNotEqual(IntPtr.Zero, sel2, "Selector cannot be null");
name1 = ObjectiveCRuntime.Selector(sel1);
Assert.AreEqual(name, name1, "Selector must be equal");
name2 = ObjectiveCRuntime.Selector(sel2);
Assert.AreEqual(name, name2, "Selector must be equal");
name = "stringWithCharacters:length:";
sel1 = ObjectiveCRuntime.Selector(name);
Assert.AreNotEqual(IntPtr.Zero, sel1, "Selector cannot be null");
sel2 = name.ToSelector();
Assert.AreNotEqual(IntPtr.Zero, sel2, "Selector cannot be null");
name1 = ObjectiveCRuntime.Selector(sel1);
Assert.AreEqual(name, name1, "Selector must be equal");
name2 = ObjectiveCRuntime.Selector(sel2);
Assert.AreEqual(name, name2, "Selector must be equal");
}
}