Monobjc.MessagingTests.TestBlockMessaging C# (CSharp) Method

TestBlockMessaging() private method

private TestBlockMessaging ( ) : void
return void
        public void TestBlockMessaging()
        {
            Id str = ObjectiveCRuntime.SendMessage<Id>(this.cls_NSString, "stringWithUTF8String:", "AbCdEfGhIjKlMnOpQrStUvWxYz");
            Assert.AreNotEqual(IntPtr.Zero, str, "String creation cannot failed");
            Id array = ObjectiveCRuntime.SendMessage<Id>(this.cls_NSArray, "arrayWithObject:", str);
            Assert.AreNotEqual(IntPtr.Zero, array, "Array creation cannot failed");
			uint count;
			if (ObjectiveCRuntime.Is64Bits) {
				count = (uint) ObjectiveCRuntime.SendMessage<ulong>(array, "count");
			} else {
				count = ObjectiveCRuntime.SendMessage<uint>(array, "count");
			}
            Assert.AreEqual(1, count, "Array must have 1 element");

            Func<Id, Id, int> comparator = delegate { return 0; };
            using (Block block = ObjectiveCRuntime.CreateBlock(comparator))
            {
                Id sortedArray = ObjectiveCRuntime.SendMessage<Id>(array, "sortedArrayUsingComparator:", block);
                Assert.AreNotEqual(IntPtr.Zero, sortedArray, "Array sort cannot failed");
				if (ObjectiveCRuntime.Is64Bits) {
					count = (uint) ObjectiveCRuntime.SendMessage<ulong>(array, "count");
				} else {
					count = ObjectiveCRuntime.SendMessage<uint>(array, "count");
				}
                Assert.AreEqual(1, count, "Array must have 1 element");
            }
        }