[{"data":1,"prerenderedAt":1879},["ShallowReactive",2],{"navigation":3,"\u002Ftesting":43,"\u002Ftesting-surround":1874},[4,8,13,18,23,28,33,38],{"title":5,"path":6,"stem":7},"Getting started","\u002F","index",{"title":9,"path":10,"stem":11,"order":12},"Numbers","\u002Fnumbers","numbers",1,{"title":14,"path":15,"stem":16,"order":17},"Rent","\u002Frent","rent",2,{"title":19,"path":20,"stem":21,"order":22},"User","\u002Fuser","user",3,{"title":24,"path":25,"stem":26,"order":27},"Free numbers","\u002Ffree","free",4,{"title":29,"path":30,"stem":31,"order":32},"Webhooks","\u002Fwebhooks","webhooks",5,{"title":34,"path":35,"stem":36,"order":37},"Testing","\u002Ftesting","testing",6,{"title":39,"path":40,"stem":41,"order":42},"Changelog","\u002Fchangelog","changelog",7,{"id":44,"title":34,"body":45,"description":1868,"extension":1869,"meta":1870,"navigation":1871,"path":35,"seo":1872,"stem":36,"__hash__":1873},"docs\u002Ftesting.md",{"type":46,"value":47,"toc":1860},"minimark",[48,68,73,164,255,376,396,457,461,479,832,858,862,890,1160,1221,1225,1254,1486,1490,1668,1672,1856],[49,50,51,55,56,59,60,63,64,67],"p",{},[52,53,54],"code",{},"MockOnlineSim"," is an in-process fake of the OnlineSim API that ships with the package. It is an ",[52,57,58],{},"OnlineSimTransport"," that answers like the real backend — same shapes, same error codes, HTTP 456 for a wrong key, HTTP 200 ",[52,61,62],{},"ERROR_WRONG_KEY"," for none — and keeps a balance, operations and rents. Your code talks to a normal ",[52,65,66],{},"OnlineSim"," client, so nothing in it changes for tests. It is deterministic: no randomness, no clock, numbers and ids come from a counter.",[69,70,72],"h2",{"id":71},"setup","Setup",[74,75,80],"pre",{"className":76,"code":77,"language":78,"meta":79,"style":79},"language-dart shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import 'package:onlinesim\u002Fonlinesim.dart';\n\nfinal mock = MockOnlineSim(balance: 10);\nfinal client = mock.client(); \u002F\u002F an OnlineSim wired to the mock\n","dart","",[52,81,82,98,104,135],{"__ignoreMap":79},[83,84,86,90,94],"span",{"class":85,"line":12},"line",[83,87,89],{"class":88},"sbssI","import",[83,91,93],{"class":92},"sfazB"," 'package:onlinesim\u002Fonlinesim.dart'",[83,95,97],{"class":96},"sMK4o",";\n",[83,99,100],{"class":85,"line":17},[83,101,103],{"emptyLinePlaceholder":102},true,"\n",[83,105,106,110,114,117,121,124,127,130,133],{"class":85,"line":22},[83,107,109],{"class":108},"spNyl","final",[83,111,113],{"class":112},"sTEyZ"," mock ",[83,115,116],{"class":96},"=",[83,118,120],{"class":119},"sBMFI"," MockOnlineSim",[83,122,123],{"class":112},"(balance",[83,125,126],{"class":96},":",[83,128,129],{"class":88}," 10",[83,131,132],{"class":112},")",[83,134,97],{"class":96},[83,136,137,139,142,144,147,150,154,157,160],{"class":85,"line":27},[83,138,109],{"class":108},[83,140,141],{"class":112}," client ",[83,143,116],{"class":96},[83,145,146],{"class":112}," mock",[83,148,149],{"class":96},".",[83,151,153],{"class":152},"s2Zo4","client",[83,155,156],{"class":112},"()",[83,158,159],{"class":96},";",[83,161,163],{"class":162},"sHwdD"," \u002F\u002F an OnlineSim wired to the mock\n",[74,165,167],{"className":76,"code":166,"language":78,"meta":79,"style":79},"MockOnlineSim({String apiKey = 'mock-key', double balance = 100, MockPrices prices = defaultMockPrices, Map\u003Cint, MockRentTariff> rentTariffs = defaultMockRentTariffs, int guardInterval = 0})\n",[52,168,169],{"__ignoreMap":79},[83,170,171,173,176,179,182,184,187,190,193,196,198,201,203,206,209,211,214,216,219,222,225,228,231,234,236,239,241,244,247,249,252],{"class":85,"line":12},[83,172,54],{"class":119},[83,174,175],{"class":112},"({",[83,177,178],{"class":119},"String",[83,180,181],{"class":112}," apiKey ",[83,183,116],{"class":96},[83,185,186],{"class":92}," 'mock-key'",[83,188,189],{"class":96},",",[83,191,192],{"class":119}," double",[83,194,195],{"class":112}," balance ",[83,197,116],{"class":96},[83,199,200],{"class":88}," 100",[83,202,189],{"class":96},[83,204,205],{"class":119}," MockPrices",[83,207,208],{"class":112}," prices ",[83,210,116],{"class":96},[83,212,213],{"class":112}," defaultMockPrices",[83,215,189],{"class":96},[83,217,218],{"class":119}," Map",[83,220,221],{"class":112},"\u003C",[83,223,224],{"class":119},"int",[83,226,227],{"class":112},", ",[83,229,230],{"class":119},"MockRentTariff",[83,232,233],{"class":112},"> rentTariffs ",[83,235,116],{"class":96},[83,237,238],{"class":112}," defaultMockRentTariffs",[83,240,189],{"class":96},[83,242,243],{"class":119}," int",[83,245,246],{"class":112}," guardInterval ",[83,248,116],{"class":96},[83,250,251],{"class":88}," 0",[83,253,254],{"class":112},"})\n",[256,257,258,274],"table",{},[259,260,261],"thead",{},[262,263,264,268,271],"tr",{},[265,266,267],"th",{},"Option",[265,269,270],{},"Default",[265,272,273],{},"Description",[275,276,277,301,316,334,353],"tbody",{},[262,278,279,285,290],{},[280,281,282],"td",{},[52,283,284],{},"apiKey",[280,286,287],{},[52,288,289],{},"'mock-key'",[280,291,292,293,296,297,300],{},"Key the mock accepts. ",[52,294,295],{},"mock.client()"," uses it; ",[52,298,299],{},"mock.client(apiKey: 'x')"," tests a wrong key.",[262,302,303,308,313],{},[280,304,305],{},[52,306,307],{},"balance",[280,309,310],{},[52,311,312],{},"100",[280,314,315],{},"Starting balance, USD.",[262,317,318,323,328],{},[280,319,320],{},[52,321,322],{},"prices",[280,324,325],{},[52,326,327],{},"{7: {'vkcom': 0.5, 'telegram': 1.2, 'google': 0.3}, 44: {'google': 0.2, 'vkcom': 0.36}}",[280,329,330,331,149],{},"Number prices (country → service → USD); replaces the defaults. Also feeds ",[52,332,333],{},"numbers.tariffs()",[262,335,336,341,346],{},[280,337,338],{},[52,339,340],{},"rentTariffs",[280,342,343],{},[52,344,345],{},"{7: MockRentTariff(days: {1: 1.0, 3: 2.5, 7: 5.0})}",[280,347,348,349,352],{},"Rent prices; ",[52,350,351],{},"extend: 0"," makes rents of that country non-extendable.",[262,354,355,360,365],{},[280,356,357],{},[52,358,359],{},"guardInterval",[280,361,362],{},[52,363,364],{},"0",[280,366,367,368,371,372,375],{},"Seconds; ",[52,369,370],{},"> 0",": an operation without SMS, or an unconfirmed rent without any SMS, cannot be closed (",[52,373,374],{},"NO_COMPLETE_TZID",").",[49,377,378,381,382,387,388,391,392,395],{},[52,379,380],{},"mock.client(apiKey:, lang:, devId:, timeout:)"," takes the usual ",[383,384,386],"a",{"href":385},"\u002F#client-options","client options"," except the transport. To build the client yourself, pass the mock as the ",[52,389,390],{},"transport","; any ",[52,393,394],{},"baseUrl"," works:",[74,397,399],{"className":76,"code":398,"language":78,"meta":79,"style":79},"import 'package:onlinesim\u002Fonlinesim.dart';\n\nfinal mock = MockOnlineSim();\nfinal client = OnlineSim(apiKey: 'mock-key', transport: mock);\n",[52,400,401,409,413,427],{"__ignoreMap":79},[83,402,403,405,407],{"class":85,"line":12},[83,404,89],{"class":88},[83,406,93],{"class":92},[83,408,97],{"class":96},[83,410,411],{"class":85,"line":17},[83,412,103],{"emptyLinePlaceholder":102},[83,414,415,417,419,421,423,425],{"class":85,"line":22},[83,416,109],{"class":108},[83,418,113],{"class":112},[83,420,116],{"class":96},[83,422,120],{"class":119},[83,424,156],{"class":112},[83,426,97],{"class":96},[83,428,429,431,433,435,438,441,443,445,447,450,452,455],{"class":85,"line":27},[83,430,109],{"class":108},[83,432,141],{"class":112},[83,434,116],{"class":96},[83,436,437],{"class":119}," OnlineSim",[83,439,440],{"class":112},"(apiKey",[83,442,126],{"class":96},[83,444,186],{"class":92},[83,446,189],{"class":96},[83,448,449],{"class":112}," transport",[83,451,126],{"class":96},[83,453,454],{"class":112}," mock)",[83,456,97],{"class":96},[69,458,460],{"id":459},"a-full-example","A full example",[49,462,463,464,467,468,471,472,474,475,478],{},"Order a number, let an SMS arrive while ",[52,465,466],{},"waitCode"," polls, check the code and the money. ",[52,469,470],{},"addSmsAfter"," delivers the SMS after a number of polls instead of after some time, so ",[52,473,466],{}," runs with ",[52,476,477],{},"interval: Duration.zero"," and the test takes milliseconds.",[74,480,482],{"className":76,"code":481,"language":78,"meta":79,"style":79},"import 'package:onlinesim\u002Fonlinesim.dart';\nimport 'package:test\u002Ftest.dart';\n\nvoid main() {\n  test('receives the code', () async {\n    final mock = MockOnlineSim(balance: 10);\n    final client = mock.client();\n\n    final order = await client.numbers.getWithNumber('google', country: 44);\n    expect(order.number, '+44900000001');\n\n    mock.addSmsAfter(order.tzid, 'Your Google code: 123-456', 2); \u002F\u002F the third poll sees it\n    final code = await client.numbers.waitCode(order.tzid, interval: Duration.zero);\n\n    expect(code, '123456');\n    expect(mock.operations().single.status, 'TZ_OVER_OK'); \u002F\u002F waitCode closed it\n    expect(mock.balance(), 9.8); \u002F\u002F the price is spent once an SMS arrived\n  });\n}\n",[52,483,484,492,501,505,516,539,560,578,583,627,650,655,689,734,739,756,793,818,826],{"__ignoreMap":79},[83,485,486,488,490],{"class":85,"line":12},[83,487,89],{"class":88},[83,489,93],{"class":92},[83,491,97],{"class":96},[83,493,494,496,499],{"class":85,"line":17},[83,495,89],{"class":88},[83,497,498],{"class":92}," 'package:test\u002Ftest.dart'",[83,500,97],{"class":96},[83,502,503],{"class":85,"line":22},[83,504,103],{"emptyLinePlaceholder":102},[83,506,507,510,513],{"class":85,"line":27},[83,508,509],{"class":108},"void",[83,511,512],{"class":152}," main",[83,514,515],{"class":112},"() {\n",[83,517,518,521,524,527,529,532,536],{"class":85,"line":32},[83,519,520],{"class":152},"  test",[83,522,523],{"class":112},"(",[83,525,526],{"class":92},"'receives the code'",[83,528,189],{"class":96},[83,530,531],{"class":112}," () ",[83,533,535],{"class":534},"s7zQu","async",[83,537,538],{"class":112}," {\n",[83,540,541,544,546,548,550,552,554,556,558],{"class":85,"line":37},[83,542,543],{"class":108},"    final",[83,545,113],{"class":112},[83,547,116],{"class":96},[83,549,120],{"class":119},[83,551,123],{"class":112},[83,553,126],{"class":96},[83,555,129],{"class":88},[83,557,132],{"class":112},[83,559,97],{"class":96},[83,561,562,564,566,568,570,572,574,576],{"class":85,"line":42},[83,563,543],{"class":108},[83,565,141],{"class":112},[83,567,116],{"class":96},[83,569,146],{"class":112},[83,571,149],{"class":96},[83,573,153],{"class":152},[83,575,156],{"class":112},[83,577,97],{"class":96},[83,579,581],{"class":85,"line":580},8,[83,582,103],{"emptyLinePlaceholder":102},[83,584,586,588,591,593,596,599,601,603,605,608,610,613,615,618,620,623,625],{"class":85,"line":585},9,[83,587,543],{"class":108},[83,589,590],{"class":112}," order ",[83,592,116],{"class":96},[83,594,595],{"class":534}," await",[83,597,598],{"class":112}," client",[83,600,149],{"class":96},[83,602,11],{"class":112},[83,604,149],{"class":96},[83,606,607],{"class":152},"getWithNumber",[83,609,523],{"class":112},[83,611,612],{"class":92},"'google'",[83,614,189],{"class":96},[83,616,617],{"class":112}," country",[83,619,126],{"class":96},[83,621,622],{"class":88}," 44",[83,624,132],{"class":112},[83,626,97],{"class":96},[83,628,630,633,636,638,641,643,646,648],{"class":85,"line":629},10,[83,631,632],{"class":152},"    expect",[83,634,635],{"class":112},"(order",[83,637,149],{"class":96},[83,639,640],{"class":112},"number",[83,642,189],{"class":96},[83,644,645],{"class":92}," '+44900000001'",[83,647,132],{"class":112},[83,649,97],{"class":96},[83,651,653],{"class":85,"line":652},11,[83,654,103],{"emptyLinePlaceholder":102},[83,656,658,661,663,665,667,669,672,674,677,679,682,684,686],{"class":85,"line":657},12,[83,659,660],{"class":112},"    mock",[83,662,149],{"class":96},[83,664,470],{"class":152},[83,666,635],{"class":112},[83,668,149],{"class":96},[83,670,671],{"class":112},"tzid",[83,673,189],{"class":96},[83,675,676],{"class":92}," 'Your Google code: 123-456'",[83,678,189],{"class":96},[83,680,681],{"class":88}," 2",[83,683,132],{"class":112},[83,685,159],{"class":96},[83,687,688],{"class":162}," \u002F\u002F the third poll sees it\n",[83,690,692,694,697,699,701,703,705,707,709,711,713,715,717,719,722,724,727,729,732],{"class":85,"line":691},13,[83,693,543],{"class":108},[83,695,696],{"class":112}," code ",[83,698,116],{"class":96},[83,700,595],{"class":534},[83,702,598],{"class":112},[83,704,149],{"class":96},[83,706,11],{"class":112},[83,708,149],{"class":96},[83,710,466],{"class":152},[83,712,635],{"class":112},[83,714,149],{"class":96},[83,716,671],{"class":112},[83,718,189],{"class":96},[83,720,721],{"class":112}," interval",[83,723,126],{"class":96},[83,725,726],{"class":119}," Duration",[83,728,149],{"class":96},[83,730,731],{"class":112},"zero)",[83,733,97],{"class":96},[83,735,737],{"class":85,"line":736},14,[83,738,103],{"emptyLinePlaceholder":102},[83,740,742,744,747,749,752,754],{"class":85,"line":741},15,[83,743,632],{"class":152},[83,745,746],{"class":112},"(code",[83,748,189],{"class":96},[83,750,751],{"class":92}," '123456'",[83,753,132],{"class":112},[83,755,97],{"class":96},[83,757,759,761,764,766,769,771,773,776,778,781,783,786,788,790],{"class":85,"line":758},16,[83,760,632],{"class":152},[83,762,763],{"class":112},"(mock",[83,765,149],{"class":96},[83,767,768],{"class":152},"operations",[83,770,156],{"class":112},[83,772,149],{"class":96},[83,774,775],{"class":112},"single",[83,777,149],{"class":96},[83,779,780],{"class":112},"status",[83,782,189],{"class":96},[83,784,785],{"class":92}," 'TZ_OVER_OK'",[83,787,132],{"class":112},[83,789,159],{"class":96},[83,791,792],{"class":162}," \u002F\u002F waitCode closed it\n",[83,794,796,798,800,802,804,806,808,811,813,815],{"class":85,"line":795},17,[83,797,632],{"class":152},[83,799,763],{"class":112},[83,801,149],{"class":96},[83,803,307],{"class":152},[83,805,156],{"class":112},[83,807,189],{"class":96},[83,809,810],{"class":88}," 9.8",[83,812,132],{"class":112},[83,814,159],{"class":96},[83,816,817],{"class":162}," \u002F\u002F the price is spent once an SMS arrived\n",[83,819,821,824],{"class":85,"line":820},18,[83,822,823],{"class":112},"  })",[83,825,97],{"class":96},[83,827,829],{"class":85,"line":828},19,[83,830,831],{"class":112},"}\n",[49,833,834,835,838,839,842,843,846,847,850,851,854,855,857],{},"The ",[52,836,837],{},"msg"," of an operation is the code by default: the first run of 4–8 digits, with spaces and dashes between digits removed (",[52,840,841],{},"123-456"," → ",[52,844,845],{},"123456","); a text without such a run comes back whole. ",[52,848,849],{},"messageToCode: false"," (or ",[52,852,853],{},"fullMessage"," in ",[52,856,466],{},") gives the full text.",[69,859,861],{"id":860},"errors","Errors",[49,863,864,867,868,871,872,850,875,878,879,882,883,886,887,375],{},[52,865,866],{},"failNext(code)"," makes the next request answer ",[52,869,870],{},"{\"response\": code}"," — the client turns it into ",[52,873,874],{},"ApiException",[52,876,877],{},"NoNumberException",") exactly as for the real server. Pass ",[52,880,881],{},"endpoint"," to fail only that endpoint. ",[52,884,885],{},"failNextTransport()"," makes the next request fail with a non-JSON HTTP 502 (",[52,888,889],{},"TransportException",[74,891,893],{"className":76,"code":892,"language":78,"meta":79,"style":79},"import 'package:onlinesim\u002Fonlinesim.dart';\nimport 'package:test\u002Ftest.dart';\n\nvoid main() {\n  test('handles a missing number and a network hiccup', () async {\n    final mock = MockOnlineSim();\n    final client = mock.client();\n\n    mock.failNext('NO_NUMBER', endpoint: 'getNum.php');\n    await expectLater(client.numbers.get('google'), throwsA(isA\u003CNoNumberException>()));\n\n    mock.failNextTransport(status: 503);\n    await expectLater(client.user.balance(), throwsA(isA\u003CTransportException>()));\n\n    expect((await client.user.balance()).balance, 100); \u002F\u002F one-shot\n  });\n}\n",[52,894,895,903,911,915,923,940,954,972,976,1004,1049,1053,1074,1108,1112,1150,1156],{"__ignoreMap":79},[83,896,897,899,901],{"class":85,"line":12},[83,898,89],{"class":88},[83,900,93],{"class":92},[83,902,97],{"class":96},[83,904,905,907,909],{"class":85,"line":17},[83,906,89],{"class":88},[83,908,498],{"class":92},[83,910,97],{"class":96},[83,912,913],{"class":85,"line":22},[83,914,103],{"emptyLinePlaceholder":102},[83,916,917,919,921],{"class":85,"line":27},[83,918,509],{"class":108},[83,920,512],{"class":152},[83,922,515],{"class":112},[83,924,925,927,929,932,934,936,938],{"class":85,"line":32},[83,926,520],{"class":152},[83,928,523],{"class":112},[83,930,931],{"class":92},"'handles a missing number and a network hiccup'",[83,933,189],{"class":96},[83,935,531],{"class":112},[83,937,535],{"class":534},[83,939,538],{"class":112},[83,941,942,944,946,948,950,952],{"class":85,"line":37},[83,943,543],{"class":108},[83,945,113],{"class":112},[83,947,116],{"class":96},[83,949,120],{"class":119},[83,951,156],{"class":112},[83,953,97],{"class":96},[83,955,956,958,960,962,964,966,968,970],{"class":85,"line":42},[83,957,543],{"class":108},[83,959,141],{"class":112},[83,961,116],{"class":96},[83,963,146],{"class":112},[83,965,149],{"class":96},[83,967,153],{"class":152},[83,969,156],{"class":112},[83,971,97],{"class":96},[83,973,974],{"class":85,"line":580},[83,975,103],{"emptyLinePlaceholder":102},[83,977,978,980,982,985,987,990,992,995,997,1000,1002],{"class":85,"line":585},[83,979,660],{"class":112},[83,981,149],{"class":96},[83,983,984],{"class":152},"failNext",[83,986,523],{"class":112},[83,988,989],{"class":92},"'NO_NUMBER'",[83,991,189],{"class":96},[83,993,994],{"class":112}," endpoint",[83,996,126],{"class":96},[83,998,999],{"class":92}," 'getNum.php'",[83,1001,132],{"class":112},[83,1003,97],{"class":96},[83,1005,1006,1009,1012,1015,1017,1019,1021,1024,1026,1028,1030,1032,1035,1037,1040,1042,1044,1047],{"class":85,"line":629},[83,1007,1008],{"class":534},"    await",[83,1010,1011],{"class":152}," expectLater",[83,1013,1014],{"class":112},"(client",[83,1016,149],{"class":96},[83,1018,11],{"class":112},[83,1020,149],{"class":96},[83,1022,1023],{"class":152},"get",[83,1025,523],{"class":112},[83,1027,612],{"class":92},[83,1029,132],{"class":112},[83,1031,189],{"class":96},[83,1033,1034],{"class":152}," throwsA",[83,1036,523],{"class":112},[83,1038,1039],{"class":152},"isA",[83,1041,221],{"class":112},[83,1043,877],{"class":119},[83,1045,1046],{"class":112},">()))",[83,1048,97],{"class":96},[83,1050,1051],{"class":85,"line":652},[83,1052,103],{"emptyLinePlaceholder":102},[83,1054,1055,1057,1059,1062,1065,1067,1070,1072],{"class":85,"line":657},[83,1056,660],{"class":112},[83,1058,149],{"class":96},[83,1060,1061],{"class":152},"failNextTransport",[83,1063,1064],{"class":112},"(status",[83,1066,126],{"class":96},[83,1068,1069],{"class":88}," 503",[83,1071,132],{"class":112},[83,1073,97],{"class":96},[83,1075,1076,1078,1080,1082,1084,1086,1088,1090,1092,1094,1096,1098,1100,1102,1104,1106],{"class":85,"line":691},[83,1077,1008],{"class":534},[83,1079,1011],{"class":152},[83,1081,1014],{"class":112},[83,1083,149],{"class":96},[83,1085,21],{"class":112},[83,1087,149],{"class":96},[83,1089,307],{"class":152},[83,1091,156],{"class":112},[83,1093,189],{"class":96},[83,1095,1034],{"class":152},[83,1097,523],{"class":112},[83,1099,1039],{"class":152},[83,1101,221],{"class":112},[83,1103,889],{"class":119},[83,1105,1046],{"class":112},[83,1107,97],{"class":96},[83,1109,1110],{"class":85,"line":736},[83,1111,103],{"emptyLinePlaceholder":102},[83,1113,1114,1116,1119,1122,1124,1126,1128,1130,1132,1135,1137,1139,1141,1143,1145,1147],{"class":85,"line":741},[83,1115,632],{"class":152},[83,1117,1118],{"class":112},"((",[83,1120,1121],{"class":534},"await",[83,1123,598],{"class":112},[83,1125,149],{"class":96},[83,1127,21],{"class":112},[83,1129,149],{"class":96},[83,1131,307],{"class":152},[83,1133,1134],{"class":112},"())",[83,1136,149],{"class":96},[83,1138,307],{"class":112},[83,1140,189],{"class":96},[83,1142,200],{"class":88},[83,1144,132],{"class":112},[83,1146,159],{"class":96},[83,1148,1149],{"class":162}," \u002F\u002F one-shot\n",[83,1151,1152,1154],{"class":85,"line":758},[83,1153,823],{"class":112},[83,1155,97],{"class":96},[83,1157,1158],{"class":85,"line":795},[83,1159,831],{"class":112},[49,1161,1162,1163,1166,1167,1170,1171,1174,1175,1178,1179,1182,1183,1186,1187,1190,1191,1194,1195,1197,1198,1178,1200,1203,1204,1207,1208,227,1211,1214,1215,227,1218,1220],{},"The state itself produces the real error codes too: ",[52,1164,1165],{},"WARNING_LOW_BALANCE"," when the balance is short, ",[52,1168,1169],{},"NO_NUMBER"," when ",[52,1172,1173],{},"reject"," matches the next number, ",[52,1176,1177],{},"UNDEFINED_COUNTRY"," \u002F ",[52,1180,1181],{},"ERROR_NO_SERVICE"," for unknown prices, ",[52,1184,1185],{},"ERROR_WRONG_TZID"," for an unknown or closed operation (",[52,1188,1189],{},"next"," too; ",[52,1192,1193],{},"ERROR_NO_TZID"," for tzid ",[52,1196,364],{},"), ",[52,1199,1177],{},[52,1201,1202],{},"UNDEFINED_DAYS"," for an unknown rent country or period, ",[52,1205,1206],{},"TRY_AGAIN_LATER"," for every refused ",[52,1209,1210],{},"rent.extend",[52,1212,1213],{},"ERROR_NO_OPERATIONS"," for an unknown rent in ",[52,1216,1217],{},"rent.close",[52,1219,62],{}," for a wrong key (HTTP 456) or no key (HTTP 200).",[69,1222,1224],{"id":1223},"inspecting-requests","Inspecting requests",[49,1226,1227,1230,1231,1234,1235,227,1238,227,1241,227,1244,1247,1248,1250,1251,149],{},[52,1228,1229],{},"mock.requests"," lists every request received: ",[52,1232,1233],{},"MockRequest"," with ",[52,1236,1237],{},"method",[52,1239,1240],{},"path",[52,1242,1243],{},"query",[52,1245,1246],{},"body","; ",[52,1249,1240],{}," is relative to ",[52,1252,1253],{},"\u002Fapi\u002F",[74,1255,1257],{"className":76,"code":1256,"language":78,"meta":79,"style":79},"import 'package:onlinesim\u002Fonlinesim.dart';\nimport 'package:test\u002Ftest.dart';\n\nvoid main() {\n  test('sends reject as a comma list', () async {\n    final mock = MockOnlineSim();\n    await mock.client().numbers.get('google', country: 44, reject: ['4470', '4471']);\n\n    final request = mock.requests.single;\n    expect(request.path, 'getNum.php');\n    expect(request.query, {'service': 'google', 'country': '44', 'reject': '4470,4471', 'lang': 'en'});\n  });\n}\n",[52,1258,1259,1267,1275,1279,1287,1304,1318,1373,1377,1399,1418,1476,1482],{"__ignoreMap":79},[83,1260,1261,1263,1265],{"class":85,"line":12},[83,1262,89],{"class":88},[83,1264,93],{"class":92},[83,1266,97],{"class":96},[83,1268,1269,1271,1273],{"class":85,"line":17},[83,1270,89],{"class":88},[83,1272,498],{"class":92},[83,1274,97],{"class":96},[83,1276,1277],{"class":85,"line":22},[83,1278,103],{"emptyLinePlaceholder":102},[83,1280,1281,1283,1285],{"class":85,"line":27},[83,1282,509],{"class":108},[83,1284,512],{"class":152},[83,1286,515],{"class":112},[83,1288,1289,1291,1293,1296,1298,1300,1302],{"class":85,"line":32},[83,1290,520],{"class":152},[83,1292,523],{"class":112},[83,1294,1295],{"class":92},"'sends reject as a comma list'",[83,1297,189],{"class":96},[83,1299,531],{"class":112},[83,1301,535],{"class":534},[83,1303,538],{"class":112},[83,1305,1306,1308,1310,1312,1314,1316],{"class":85,"line":37},[83,1307,543],{"class":108},[83,1309,113],{"class":112},[83,1311,116],{"class":96},[83,1313,120],{"class":119},[83,1315,156],{"class":112},[83,1317,97],{"class":96},[83,1319,1320,1322,1324,1326,1328,1330,1332,1334,1336,1338,1340,1342,1344,1346,1348,1350,1352,1355,1357,1360,1363,1365,1368,1371],{"class":85,"line":42},[83,1321,1008],{"class":534},[83,1323,146],{"class":112},[83,1325,149],{"class":96},[83,1327,153],{"class":152},[83,1329,156],{"class":112},[83,1331,149],{"class":96},[83,1333,11],{"class":112},[83,1335,149],{"class":96},[83,1337,1023],{"class":152},[83,1339,523],{"class":112},[83,1341,612],{"class":92},[83,1343,189],{"class":96},[83,1345,617],{"class":112},[83,1347,126],{"class":96},[83,1349,622],{"class":88},[83,1351,189],{"class":96},[83,1353,1354],{"class":112}," reject",[83,1356,126],{"class":96},[83,1358,1359],{"class":112}," [",[83,1361,1362],{"class":92},"'4470'",[83,1364,189],{"class":96},[83,1366,1367],{"class":92}," '4471'",[83,1369,1370],{"class":112},"])",[83,1372,97],{"class":96},[83,1374,1375],{"class":85,"line":580},[83,1376,103],{"emptyLinePlaceholder":102},[83,1378,1379,1381,1384,1386,1388,1390,1393,1395,1397],{"class":85,"line":585},[83,1380,543],{"class":108},[83,1382,1383],{"class":112}," request ",[83,1385,116],{"class":96},[83,1387,146],{"class":112},[83,1389,149],{"class":96},[83,1391,1392],{"class":112},"requests",[83,1394,149],{"class":96},[83,1396,775],{"class":112},[83,1398,97],{"class":96},[83,1400,1401,1403,1406,1408,1410,1412,1414,1416],{"class":85,"line":629},[83,1402,632],{"class":152},[83,1404,1405],{"class":112},"(request",[83,1407,149],{"class":96},[83,1409,1240],{"class":112},[83,1411,189],{"class":96},[83,1413,999],{"class":92},[83,1415,132],{"class":112},[83,1417,97],{"class":96},[83,1419,1420,1422,1424,1426,1428,1430,1433,1436,1438,1441,1443,1446,1448,1451,1453,1456,1458,1461,1463,1466,1468,1471,1474],{"class":85,"line":652},[83,1421,632],{"class":152},[83,1423,1405],{"class":112},[83,1425,149],{"class":96},[83,1427,1243],{"class":112},[83,1429,189],{"class":96},[83,1431,1432],{"class":112}," {",[83,1434,1435],{"class":92},"'service'",[83,1437,126],{"class":96},[83,1439,1440],{"class":92}," 'google'",[83,1442,189],{"class":96},[83,1444,1445],{"class":92}," 'country'",[83,1447,126],{"class":96},[83,1449,1450],{"class":92}," '44'",[83,1452,189],{"class":96},[83,1454,1455],{"class":92}," 'reject'",[83,1457,126],{"class":96},[83,1459,1460],{"class":92}," '4470,4471'",[83,1462,189],{"class":96},[83,1464,1465],{"class":92}," 'lang'",[83,1467,126],{"class":96},[83,1469,1470],{"class":92}," 'en'",[83,1472,1473],{"class":112},"})",[83,1475,97],{"class":96},[83,1477,1478,1480],{"class":85,"line":657},[83,1479,823],{"class":112},[83,1481,97],{"class":96},[83,1483,1484],{"class":85,"line":691},[83,1485,831],{"class":112},[69,1487,1489],{"id":1488},"control-api","Control API",[256,1491,1492,1501],{},[259,1493,1494],{},[262,1495,1496,1499],{},[265,1497,1498],{},"Member",[265,1500,273],{},[275,1502,1503,1516,1531,1548,1576,1595,1611,1628,1649,1658],{},[262,1504,1505,1510],{},[280,1506,1507],{},[52,1508,1509],{},"client({apiKey, lang, devId, timeout})",[280,1511,1512,1513,1515],{},"A normal ",[52,1514,66],{}," wired to the mock.",[262,1517,1518,1523],{},[280,1519,1520],{},[52,1521,1522],{},"send(request)",[280,1524,1525,1526,1528,1529,149],{},"The mock is an ",[52,1527,58],{},": pass it as ",[52,1530,390],{},[262,1532,1533,1538],{},[280,1534,1535],{},[52,1536,1537],{},"addSms(tzid, text, {service})",[280,1539,1540,1541,1543,1544,1547],{},"An SMS arrives now at a number operation or a rent (detected by ",[52,1542,671],{},"). Throws ",[52,1545,1546],{},"StateError"," for an unknown or closed one.",[262,1549,1550,1555],{},[280,1551,1552],{},[52,1553,1554],{},"addSmsAfter(tzid, text, polls, {service})",[280,1556,1557,1558,1561,1562,1564,1565,6,1568,227,1571,6,1574,375],{},"The SMS arrives after ",[52,1559,1560],{},"polls"," state requests for ",[52,1563,671],{}," (",[52,1566,1567],{},"numbers.state",[52,1569,1570],{},"stateOne",[52,1572,1573],{},"rent.state",[52,1575,1570],{},[262,1577,1578,1583],{},[280,1579,1580],{},[52,1581,1582],{},"failNext(code, {endpoint})",[280,1584,1585,1586,1588,1589,1592,1593,149],{},"The next request (to ",[52,1587,881],{}," only, e.g. ",[52,1590,1591],{},"'getNum.php'",") answers ",[52,1594,870],{},[262,1596,1597,1602],{},[280,1598,1599],{},[52,1600,1601],{},"failNextTransport({status, endpoint})",[280,1603,1604,1605,1607,1608,375],{},"The next request fails with a non-JSON body and HTTP ",[52,1606,780],{}," (default ",[52,1609,1610],{},"502",[262,1612,1613,1621],{},[280,1614,1615,1178,1618],{},[52,1616,1617],{},"setBalance(usd)",[52,1619,1620],{},"balance()",[280,1622,1623,1624,1627],{},"Set \u002F read the total balance, USD (it includes the part frozen by open operations, as ",[52,1625,1626],{},"user.balance()"," reports it).",[262,1629,1630,1638],{},[280,1631,1632,1178,1635],{},[52,1633,1634],{},"operations()",[52,1636,1637],{},"rents()",[280,1639,1640,1641,1644,1645,1648],{},"Snapshots of the current number operations (",[52,1642,1643],{},"MockOperation",") \u002F open rents (",[52,1646,1647],{},"MockRent","), for assertions.",[262,1650,1651,1655],{},[280,1652,1653],{},[52,1654,1392],{},[280,1656,1657],{},"Log of the requests received.",[262,1659,1660,1665],{},[280,1661,1662],{},[52,1663,1664],{},"reset()",[280,1666,1667],{},"Back to the constructor's state.",[69,1669,1671],{"id":1670},"what-the-mock-does","What the mock does",[1673,1674,1675,1711,1777,1830,1839],"ul",{},[1676,1677,1678,1681,1682,1684,1685,1688,1689,1691,1692,1695,1696,1699,1700,1703,1704,1706,1707,1710],"li",{},[1679,1680,9],"strong",{},": ",[52,1683,1023],{}," freezes the price; ",[52,1686,1687],{},"close"," after an SMS spends it, ",[52,1690,1687],{}," without one refunds it; ",[52,1693,1694],{},"ban"," after an SMS answers ",[52,1697,1698],{},"\"0\"",", like the server. Numbers are ",[52,1701,1702],{},"+\u003Ccountry>9000000NN",", ids count from 1. ",[52,1705,1189],{}," switches to the following SMS. The operation's ",[52,1708,1709],{},"time"," stays at 1200 s — there is no clock.",[1676,1712,1713,1681,1715,1717,1718,1720,1721,227,1723,1720,1726,1729,1730,1733,1734,1737,1738,1720,1740,1743,1744,1747,1748,1720,1750,1752,1753,1756,1757,1759,1760,1763,1764,6,1766,1768,1769,1772,1773,1776],{},[1679,1714,14],{},[52,1716,1023],{}," reserves the price (",[52,1719,780],{}," ",[52,1722,364],{},[52,1724,1725],{},"checked",[52,1727,1728],{},"false",") and keeps the ",[52,1731,1732],{},"extension"," flag; the first SMS that is not ",[52,1735,1736],{},"notify"," confirms the rent (",[52,1739,780],{},[52,1741,1742],{},"1",") and charges it — ",[52,1745,1746],{},"addSms(tzid, text, service: 'notify')"," adds a notice with ",[52,1749,52],{},[52,1751,364],{}," that confirms nothing. ",[52,1754,1755],{},"extend"," works on a confirmed rent and charges at once. ",[52,1758,1687],{}," releases the reservation of an unconfirmed rent and gives no refund for a confirmed one. ",[52,1761,1762],{},"sum"," is a number in ",[52,1765,1023],{},[52,1767,1755],{}," and a decimal string on the wire of ",[52,1770,1771],{},"state",", like the server. SMS appear in ",[52,1774,1775],{},"messages",", newest first.",[1676,1778,1779,1681,1781,1783,1784,1787,1788,1791,1792,1795,1796,1799,1800,1804,1805,1808,1809,1720,1811,1814,1815,1817,1818,1821,1822,1825,1826,1829],{},[1679,1780,19],{},[52,1782,307],{}," (frozen part included), a fixed profile, ",[52,1785,1786],{},"setWebhookUrl"," accepts any ",[52,1789,1790],{},"scheme:\u002F\u002F…"," URL (",[52,1793,1794],{},"VALIDATION_ERROR"," otherwise), ",[52,1797,1798],{},"webhookLogs"," lists the deliveries the mock ",[1801,1802,1803],"em",{},"recorded"," when an SMS arrived while a webhook URL was set — it makes no HTTP call; their ",[52,1806,1807],{},"params"," follow the real payload (",[52,1810,52],{},[52,1812,1813],{},"''"," without a code, rent ",[52,1816,640],{}," in digits without ",[52,1819,1820],{},"+",", rent ",[52,1823,1824],{},"timeLeft"," in minutes). ",[52,1827,1828],{},"paymentHistory"," has no orders.",[1676,1831,1832,1681,1835,1838],{},[1679,1833,1834],{},"Free",[52,1836,1837],{},"free.list"," returns two fixed countries (44 first) with one number and a few SMS each.",[1676,1840,1841,1842,1564,1845,1848,1849,1851,1852,1855],{},"Not imitated: anything that needs real time — the 5 s lock after ",[52,1843,1844],{},"setOperationOk",[52,1846,1847],{},"INTERVAL_CONCURRENT_REQUESTS_ERROR","), the 10 s lock of ",[52,1850,1210],{},", the 120 s before an unconfirmed rent may be closed and its 20-minute wait for the first SMS. ",[52,1853,1854],{},"guardInterval > 0"," stands in for \"too early to close\".",[1857,1858,1859],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}",{"title":79,"searchDepth":17,"depth":17,"links":1861},[1862,1863,1864,1865,1866,1867],{"id":71,"depth":17,"text":72},{"id":459,"depth":17,"text":460},{"id":860,"depth":17,"text":861},{"id":1223,"depth":17,"text":1224},{"id":1488,"depth":17,"text":1489},{"id":1670,"depth":17,"text":1671},"Test your integration offline with MockOnlineSim — no network, key or money.","md",{},{"order":37},{"title":34,"description":1868},"1ubWJ28vUlno0CNluAgC37xNEgo20qP7i65-9B6PT1k",[1875,1877],{"title":14,"path":15,"stem":16,"description":1876,"order":17},"Rent a number for days and receive every SMS sent to it — client.rent.",{"title":19,"path":20,"stem":21,"description":1878,"order":22},"Balance, profile, payments and the webhook URL — client.user.",1795164323296]