예제 #1
0
        public void CreateInterface_EnsureValidName()
        {
            var xml   = XDocument.Parse("<package name=\"com.example.test\" jni-name=\"com/example/test\"><interface name=\"$3\" /></package>");
            var iface = XmlApiImporter.CreateInterface(xml.Root, xml.Root.Element("interface"));

            Assert.AreEqual("I_3", iface.Name);
        }
예제 #2
0
        public void CreateInterface_CorrectApiSinceOverridePackage()
        {
            // Make sure we inherit it from <package>.
            var xml   = XDocument.Parse("<package name='com.example.test' jni-name='com/example/test' api-since='7'><interface name='myclass' api-since='9' /></package>");
            var iface = XmlApiImporter.CreateInterface(xml.Root, xml.Root.Element("interface"), opt);

            Assert.AreEqual(9, iface.ApiAvailableSince);
        }
예제 #3
0
        public void Interface()
        {
            var element    = package.Element("interface");
            var @interface = XmlApiImporter.CreateInterface(package, element);

            Assert.IsTrue(@interface.Validate(options, new GenericParameterDefinitionList(), new CodeGeneratorContext()), "interface.Validate failed!");

            Assert.AreEqual("public", @interface.Visibility);
            Assert.AreEqual("IService", @interface.Name);
            Assert.AreEqual("com.mypackage.service", @interface.JavaName);
            Assert.AreEqual("Lcom/mypackage/service;", @interface.JniName);
        }