예제 #1
0
        public void ComplexAsVariant()
        {
            MyTuple2 cpx = new MyTuple2();

            cpx.A    = "a";
            cpx.B    = "b";
            cpx.C    = new Dictionary <int, MyTuple> ();
            cpx.C[3] = new MyTuple("foo", "bar");
            object cpxRet = test.ComplexAsVariant(cpx, 12);
            //MyTuple2 mt2ret = (MyTuple2)Convert.ChangeType (cpxRet, typeof (MyTuple2));
            var mt2ret = (DBusStruct <string, string, Dictionary <int, DBusStruct <string, string> > >)cpxRet;

            Assert.AreEqual(cpx.A, mt2ret.Item1);
            Assert.AreEqual(cpx.B, mt2ret.Item2);
            Assert.AreEqual(cpx.C[3].A, mt2ret.Item3[3].Item1);
            Assert.AreEqual(cpx.C[3].B, mt2ret.Item3[3].Item2);
        }
예제 #2
0
		public void ComplexAsVariant ()
		{
			MyTuple2 cpx = new MyTuple2 ();
			cpx.A = "a";
			cpx.B = "b";
			cpx.C = new Dictionary<int,MyTuple> ();
			cpx.C[3] = new MyTuple("foo", "bar");
			object cpxRet = test.ComplexAsVariant (cpx, 12);
			//MyTuple2 mt2ret = (MyTuple2)Convert.ChangeType (cpxRet, typeof (MyTuple2));
			var mt2ret = (DBusStruct<string, string, Dictionary<int, DBusStruct<string, string>>>)cpxRet;
			Assert.AreEqual (cpx.A, mt2ret.Item1);
			Assert.AreEqual (cpx.B, mt2ret.Item2);
			Assert.AreEqual (cpx.C[3].A, mt2ret.Item3[3].Item1);
			Assert.AreEqual (cpx.C[3].B, mt2ret.Item3[3].Item2);
		}