Monobjc.SymbolTests.TestFrameworkExternals C# (CSharp) Метод

TestFrameworkExternals() приватный Метод

private TestFrameworkExternals ( ) : void
Результат void
        public void TestFrameworkExternals()
        {
            ObjectiveCRuntime.LoadFramework("Foundation");
            ObjectiveCRuntime.LoadFramework("AppKit");
            ObjectiveCRuntime.LoadFramework("CoreLocation");
            ObjectiveCRuntime.LoadFramework("DiscRecording");
            ObjectiveCRuntime.LoadFramework("WebKit");
            ObjectiveCRuntime.Initialize();

            Id value = ObjectiveCRuntime.GetExtern<Id>("WebKit", "WebViewDidChangeNotification");
            Assert.AreNotEqual(IntPtr.Zero, value.NativePointer, "Symbol must be found");

            IntPtr str = ObjectiveCRuntime.SendMessage<IntPtr>(value, "UTF8String");
            Assert.AreNotEqual(IntPtr.Zero, str, "Symbol must have a valid value");

            String s = Marshal.PtrToStringAuto(str);
            Assert.AreEqual("WebViewDidChangeNotification", s, "Symbol must have the right value");

            int @int = ObjectiveCRuntime.GetExtern<int>("QuartzCore", "kCIFormatARGB8");
            Assert.AreNotEqual(Int32.MinValue, @int, "Symbol must be found");
            Assert.AreEqual(23, @int, "Symbol must have the right value");

            float @float = ObjectiveCRuntime.GetExtern<float>("DiscRecording", "DRDeviceBurnSpeedMax");
            Assert.AreNotEqual(Single.NaN, @float, "Symbol must be found");
            Assert.AreEqual(65535.0f, @float, "Symbol must have the right value");

            double @double = ObjectiveCRuntime.GetExtern<double>("CoreLocation", "kCLLocationAccuracyNearestTenMeters");
            Assert.AreNotEqual(Double.NaN, @double, "Symbol must be found");
            Assert.AreEqual(10.0d, @double, "Symbol must have the right value");
        }
    }