【文件属性】:
文件名称:NLTHTTPStubServer:假服务器进行iOS测试
文件大小:35KB
文件格式:ZIP
更新时间:2021-05-12 18:44:40
Objective-C
NLTHTTPStubServer
用于iOS测试的伪造服务器。
可以根据expect或stub登记伪造的响应。
[[[server expect] forPath:@"/api/"] andJSONResponseResource:@"fake-response" ofType:@"json"];
准备好
与 。
Podfile:
pod 'NLTHTTPStubServer'
在TestCase顶部导入NLTHTTPStubServer.h 。
第一步
GHUnit异步测试用例的最简单示例。 服务器URL默认为localhost:12345 。
- ( void )testMostSimply {
// Get shared server instance.
server = [NLTHTTPStubServer sharedServer ];
【文件预览】:
NLTHTTPStubServer-master
----NLTHTTPStubServer.xcodeproj()
--------project.pbxproj(33KB)
----Podfile.lock(701B)
----NLTHTTPStubServer.podspec(797B)
----NLTHTTPStubServerTests()
--------NLTHTTPStubConnetionTest.h(224B)
--------WithNSURLConnectionTest.m(9KB)
--------NLTHTTPStubResponseTest.h(222B)
--------en.lproj()
--------test.txt(16B)
--------fake.json(24B)
--------main.m(310B)
--------NLTHTTPStubServerTests-Prefix.pch(347B)
--------NLTHTTPStubServerTest.m(9KB)
--------test.json(47B)
--------NLTPathTest.m(4KB)
--------NLTHTTPDataStubResponseTest.h(236B)
--------NLTHTTPStubServerTests-Info.plist(1KB)
--------NLTHTTPStubServerTest.h(218B)
--------NLTHTTPDataStubResponseTest.m(3KB)
--------NLTHTTPStubResponseTest.m(17KB)
--------NLTHTTPStubConnetionTest.m(3KB)
----NLTHTTPStubServer()
--------NLTPath.h(710B)
--------NLTPath.m(3KB)
--------NLTSConsts.h(3KB)
--------NLTHTTPStubResponse.m(9KB)
--------NLTHGlobalSettings.h(318B)
--------NLTHTTPStubConnection.m(3KB)
--------NLTHTTPDataStubResponse.m(1KB)
--------NLTHTTPStubServer.h(967B)
--------NLTHTTPStubServer.m(4KB)
--------NLTHTTPStubResponse.h(1KB)
--------NLTHTTPStubServer-Prefix.pch(175B)
--------NLTHTTPDataStubResponse.h(466B)
--------NLTHTTPStubConnection.h(381B)
--------NLTHGlobalSettings.m(566B)
----Podfile(79B)
----LICENSE(1KB)
----README.md(4KB)
----.gitignore(209B)
----NLTHTTPStubServer.xcworkspace()
--------contents.xcworkspacedata(177B)
----CHANGELOG.md(164B)