Ejemplo n.º 1
0
        public void FromNativeToBridge()
        {
            var XKeys = new NSString[] { (NSString)"key" };
            var XObj  = new NSObject[] { (NSString)"value" };

            NITTrackingInfo NTrack =
                NITTrackingInfo.TrackingInfoFromRecipeId("recid",
                                                         NSDictionary <NSString, NSObject> .FromObjectsAndKeys(XObj, XKeys));

            NITFeedback NFeed = new NITFeedback();

            NFeed.Question            = "Question?";
            NFeed.NotificationMessage = "ciao";
            NFeed.RecipeId            = "rec-id";
            NFeed.TrackingInfo        = NTrack;
            XCFeedbackNotification XFeed = AdapterFeedback.GetCommonType(NFeed);

            Assert.True(XFeed.Question.Equals(NFeed.Question));
            Assert.NotNull(XFeed.TrackingInfo.extras);
            object value = XFeed.TrackingInfo.extras["key"];

            Assert.NotNull(value);
            Assert.True(value is string);
            Assert.True(XFeed.TrackingInfo.extras["key"].Equals("value"));
        }
Ejemplo n.º 2
0
            public override void GotFeedback(NITFeedback Feedback, NITTrackingInfo TrackingInfo)
            {
                XCFeedbackNotification XFeedback = AdapterFeedback.GetCommonType(Feedback);

                if (NearPCL.GetContentManager() != null)
                {
                    NearPCL.GetContentManager().GotXFeedbackNotification(XFeedback);
                }
                else
                {
                    Console.WriteLine("You receive a content but you haven't registered a content manager");
                }
            }
Ejemplo n.º 3
0
        public void FromNativeToBridge()
        {
            TrackingInfo NTrack = new TrackingInfo();

            NTrack.RecipeId = "recid";
            NTrack.Metadata = new Dictionary <Java.Lang.String, Java.Lang.Object>();
            NTrack.Metadata.Add("key", "value");

            Feedback NFeed = new Feedback();

            NFeed.Question            = "Question?";
            NFeed.NotificationMessage = "ciao";
            NFeed.RecipeId            = "rec-id";
            NFeed.TrackingInfo        = NTrack;

            XCFeedbackNotification XFeed = AdapterFeedback.GetCommonType(NFeed);

            Assert.True(XFeed.Question.Equals(NFeed.Question));
            Assert.True(XFeed.TrackingInfo.extras["key"].Equals("value"));
        }