Exemplo n.º 1
0
        public void tooBig()
        {
            String      msgContent = "娣卞湷鍒堕�犲巶鐨勬湅鍙嬪憡璇夋垜锛岃繃鍘荤殑涓�骞达紝浠栦滑鏈嶅姟浜嗗嚑鍗佸灏忓瀷鍒涗笟鍏徃锛屼唬宸ユ櫤鑳芥墜琛ㄣ�備笉杩囷紝浠婂勾杩欎簺鍒涗笟鍏徃宸茬粡鎵句笉鍒颁簡锛屽簡骞哥殑鏄紝浠e伐鍘傞兘鏄厛浠樻鍐嶇敓浜э紝涔熷氨娌℃湁鎹熷け銆傚彲绌挎埓璁惧銆佺‖浠跺垱鏂帮紝澶ф疆鍒濊捣锛屾偿娌欎勘涓嬶紝娴疆杩囧悗锛屽嵈鏄亶鍦扮嫾钘夈�傚浗鍐呯殑鏅鸿兘鎵嬬幆銆佹墜琛ㄤ滑锛屽鍦熸浖銆佹灉澹筹紝鍦� Jawbone銆丟oogle Glass 浠紩棰嗕笅锛岀悍绾锋帹鍑衡�滃垝鏃朵唬鈥濈殑浜у搧锛屼竴鏃堕棿锛屽浗鍐呭绉拌鍋氬彲绌挎埓璁惧鐨勫叕鍙革紝濡傝繃姹熶箣椴��2013 骞达紝涓嶈鍙ョ‖浠跺垱鏂帮紝涓嶆埓娆炬櫤鑳芥墜鐜紝閮戒笉濂芥剰鎬濊鑷繁鏄珯鍦ㄤ汉鏂囦笌绉戞妧鐨勫崄瀛楄矾鍙c��2013 骞达紝韬竟鐨勬湅鍙嬬悍绾蜂僵鎴翠笂浜� Jawbone锛屽垢杩愮殑浜轰篃浼氭埓涓婁紶璇翠腑鐨勬櫤鑳芥墜琛ㄣ�備笉杩囷紝鐜板湪瓒婃潵瓒婂鐨勬湅鍙嬪紑濮嬫斁寮冭繖浜涙墍璋撶殑鍙┛鎴村紡璁惧銆�";
            PushPayload payload    = PushPayload.MessageAll(msgContent);
            String      content    = payload.ToString();

            Console.WriteLine("len: " + System.Text.UTF8Encoding.UTF8.GetByteCount(content));
            try {
                var result = _client.SendPush(payload);
            } catch (APIRequestException e) {
                Assert.AreEqual(TOO_BIG, e.ErrorCode);
            }
        }