public void TestFormUpdateCallback (string apiMethod, string widgetType)
        {
            RogerthatCallbackApiHandler handler = new RogerthatCallbackApiHandler ();
            handler.Subscribe (this.formUpdateDelegates [widgetType]);

            TestCallback (handler, apiMethod, widgetType);
        }
        private void TestCallback (RogerthatCallbackApiHandler handler, string apiMethod, string subType)
        {
            CultureInfo usCulture = new CultureInfo ("en-US");
            Thread.CurrentThread.CurrentCulture = usCulture;

            IDictionary<String, object> jsonRpcData = RogerthatCallbackApiHandler.ReadJsonRpcData (GetInputStream (apiMethod, subType));
            string requestId = (string)jsonRpcData ["id"];
            Assert.IsNotNull (requestId);
            Assert.IsNotEmpty (requestId);
            string requestMethod = (string)jsonRpcData ["method"];
            Assert.AreEqual (apiMethod, requestMethod);
            IDictionary<string, object> requestParameters = (IDictionary<string, object>)jsonRpcData ["parameters"];
            Assert.IsNotNull (requestParameters);
            
            Response result = handler.ExecuteMethod (requestMethod, requestParameters);
            Assert.IsNotNull (result);
            // Check if response is valid json. An improvement would be to add result json.txt files for all callbacks, but we have too much work at this moment.
            using (Stream memoryStream = new MemoryStream ()) {
                using (StreamWriter sw = new StreamWriter (memoryStream)) {
                    handler.WriteResponse (requestId, result, null, sw);
                    sw.Flush ();
                    memoryStream.Seek (0, SeekOrigin.Begin);
                    RogerthatCallbackApiHandler.ReadJsonRpcData (memoryStream);
                }
            }
        }
        public void TestNormalCallback (string apiMethod)
        {
            RogerthatCallbackApiHandler handler = new RogerthatCallbackApiHandler ();
            handler.Subscribe (this.testDelegate);
            handler.Subscribe (this.updateDelegate);
            handler.Subscribe (this.flowMemberResultDelegate);
            handler.Subscribe (this.pokeDelegate);
            handler.Subscribe (this.inviteResultDelegate);
            handler.Subscribe (this.invitedDelegate);
            handler.Subscribe (this.brokeUpDelegate);
            handler.Subscribe (this.inReachDelegate);
            handler.Subscribe (this.outOfReachDelegate);
            handler.Subscribe (this.locationFixDelegate);
            handler.Subscribe (this.apiCallDelegate);

            TestCallback (handler, apiMethod, null);
        }