public void AddInterface()
        {
            AllJoyn.InterfaceDescription testIntf = null;
            Assert.Equal(AllJoyn.QStatus.OK, busAttachment.CreateInterface(INTERFACE_NAME, out testIntf));
            Assert.NotNull(testIntf);
            Assert.Equal(AllJoyn.QStatus.OK, testIntf.AddMember(AllJoyn.Message.Type.MethodCall, "ping", "s", "s", "in,out"));
            testIntf.Activate();

            proxyBusObject = new AllJoyn.ProxyBusObject(busAttachment, "org.alljoyn.Bus", "/org/alljoyn/Bus", 0);
            Assert.NotNull(proxyBusObject);

            Assert.Equal(AllJoyn.QStatus.OK, proxyBusObject.AddInterface(testIntf));

            Assert.True(proxyBusObject.ImplementsInterface(INTERFACE_NAME));
        }
        public void ImplementsInterface()
        {
            proxyBusObject = new AllJoyn.ProxyBusObject(busAttachment, "org.alljoyn.Bus", "/org/alljoyn/Bus", 0);
            Assert.NotNull(proxyBusObject);

            Assert.Equal(AllJoyn.QStatus.OK, proxyBusObject.IntrospectRemoteObject());

            Assert.True(proxyBusObject.ImplementsInterface("org.alljoyn.Bus"));
            Assert.True(proxyBusObject.ImplementsInterface("org.alljoyn.Daemon"));
            Assert.False(proxyBusObject.ImplementsInterface("org.alljoyn.Invalid"));
        }
        public void ParseXml()
        {
            string busObjectXML = "<node name=\"/org/alljoyn/test/ProxyObjectTest\">" +
                                    "  <interface name=\"org.alljoyn.test.ProxyBusObjectTest\">\n" +
                                    "    <signal name=\"chirp\">\n" +
                                    "      <arg name=\"chirp\" type=\"s\"/>\n" +
                                    "    </signal>\n" +
                                    "    <signal name=\"chirp2\">\n" +
                                    "      <arg name=\"chirp\" type=\"s\" direction=\"out\"/>\n" +
                                    "    </signal>\n" +
                                    "    <method name=\"ping\">\n" +
                                    "      <arg name=\"in\" type=\"s\" direction=\"in\"/>\n" +
                                    "      <arg name=\"out\" type=\"s\" direction=\"out\"/>\n" +
                                    "    </method>\n" +
                                    "  </interface>\n" +
                                    "</node>\n";

            proxyBusObject = new AllJoyn.ProxyBusObject(busAttachment, null, null, 0);
            Assert.NotNull(proxyBusObject);

            Assert.Equal(AllJoyn.QStatus.OK, proxyBusObject.ParseXml(busObjectXML));

            Assert.True(proxyBusObject.ImplementsInterface("org.alljoyn.test.ProxyBusObjectTest"));

            AllJoyn.InterfaceDescription iface = proxyBusObject.GetInterface("org.alljoyn.test.ProxyBusObjectTest");
            Assert.NotNull(iface);

            string expectedIntrospect = "<interface name=\"org.alljoyn.test.ProxyBusObjectTest\">\n" +
                                        "  <signal name=\"chirp\">\n" +
                                        "    <arg name=\"chirp\" type=\"s\" direction=\"out\"/>\n" +
                                        "  </signal>\n" +
                                        "  <signal name=\"chirp2\">\n" +
                                        "    <arg name=\"chirp\" type=\"s\" direction=\"out\"/>\n" +
                                        "  </signal>\n" +
                                        "  <method name=\"ping\">\n" +
                                        "    <arg name=\"in\" type=\"s\" direction=\"in\"/>\n" +
                                        "    <arg name=\"out\" type=\"s\" direction=\"out\"/>\n" +
                                        "  </method>\n" +
                                        "</interface>\n";
            Assert.Equal(expectedIntrospect, iface.Introspect());
        }
		public void ImplementsInterface()
		{
			AllJoyn.BusAttachment busAttachment = new AllJoyn.BusAttachment("ProxyBusObjectTest", false);
			Assert.Equal(AllJoyn.QStatus.OK, busAttachment.Start());
			Assert.Equal(AllJoyn.QStatus.OK, busAttachment.Connect(AllJoynTestCommon.GetConnectSpec()));

			AllJoyn.ProxyBusObject proxyBusObject = new AllJoyn.ProxyBusObject(busAttachment, "org.alljoyn.Bus", "/org/alljoyn/Bus", 0);
			Assert.NotNull(proxyBusObject);

			Assert.Equal(AllJoyn.QStatus.OK, proxyBusObject.IntrospectRemoteObject());

			Assert.True(proxyBusObject.ImplementsInterface("org.alljoyn.Bus"));
			Assert.True(proxyBusObject.ImplementsInterface("org.alljoyn.Daemon"));
			Assert.False(proxyBusObject.ImplementsInterface("org.alljoyn.Invalid"));
		}