Monobjc.EncodingGenerationTests.TestSelectorEncodingForMethods C# (CSharp) Method

TestSelectorEncodingForMethods() private method

private TestSelectorEncodingForMethods ( ) : void
return void
        public void TestSelectorEncodingForMethods()
        {
            MethodInfo methodInfo;

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", Type.EmptyTypes);
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v16@0:8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v8@0:4", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", new[] {typeof (bool)});
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v20@0:8c16", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v12@0:4c8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", new[] {typeof (char)});
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v20@0:8S16", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v12@0:4S8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", new[] {typeof (short)});
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v20@0:8s16", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v12@0:4s8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", new[] {typeof (int)});
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v20@0:8i16", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v12@0:4i8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", new[] {typeof (long)});
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v24@0:8q16", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v16@0:4q8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", new[] {typeof (float)});
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v20@0:8f16", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v12@0:4f8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }

            methodInfo = typeof (TestClassForMethodWithoutReturnType).GetMethod("DoNoReturn", new[] {typeof (double)});
            Assert.IsNotNull(methodInfo, "Method cannot be null");
            if (ObjectiveCRuntime.Is64Bits)
            {
                Assert.AreEqual("v24@0:8d16", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
            else
            {
                Assert.AreEqual("v16@0:4d8", ObjectiveCEncoding.GetSignature(methodInfo), "Selector encoding don't match");
            }
        }