示例#1
0
        /// <summary>
        /// Class whih represents API methods of FB Messenger
        /// </summary>
        /// <param name="token">access_token of application</param>
        public MessengerAPI(string token)
        {
            IHttpWebRequestFactory requestFactory = new HttpWebRequestFactory();

            _token          = token;
            _requestsSender = new WebRequestSender(requestFactory);
        }
示例#2
0
        public void Init()
        {
            _httpWebRequestFactoryMock = new Mock <IHttpWebRequestFactory>();
            _requestSender             = new WebRequestSender(_httpWebRequestFactoryMock.Object);

            var expected      = "{ \"result\" : \"test value\" }";
            var expectedBytes = Encoding.UTF8.GetBytes(expected);

            _responseStream = new MemoryStream();
            _responseStream.Write(expectedBytes, 0, expectedBytes.Length);
            _responseStream.Seek(0, SeekOrigin.Begin);
        }