fix: renamed and moved tests

This commit is contained in:
DenserMeerkat
2023-12-27 21:57:26 +05:30
parent 3fd0a1933c
commit f74426f2d5
12 changed files with 1140 additions and 1186 deletions

View File

@ -149,6 +149,83 @@ void main() {
}""";
expect(harCodeGen.getCode(requestModelGet8, "https"), expectedCode);
});
test('GET 9', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social?num=8700000&add_space=true",
"httpVersion": "HTTP/1.1",
"queryString": [
{
"name": "num",
"value": "8700000"
},
{
"name": "add_space",
"value": "true"
}
],
"headers": []
}""";
expect(harCodeGen.getCode(requestModelGet9, "https"), expectedCode);
});
test('GET 10', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social",
"httpVersion": "HTTP/1.1",
"queryString": [],
"headers": [
{
"name": "User-Agent",
"value": "Test Agent"
}
]
}""";
expect(
harCodeGen.getCode(
requestModelGet10,
"https",
),
expectedCode);
});
test('GET 11', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social?num=8700000&digits=3",
"httpVersion": "HTTP/1.1",
"queryString": [
{
"name": "num",
"value": "8700000"
},
{
"name": "digits",
"value": "3"
}
],
"headers": [
{
"name": "User-Agent",
"value": "Test Agent"
}
]
}""";
expect(harCodeGen.getCode(requestModelGet11, "https"), expectedCode);
});
test('GET 12', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social",
"httpVersion": "HTTP/1.1",
"queryString": [],
"headers": []
}""";
expect(harCodeGen.getCode(requestModelGet12, "https"), expectedCode);
});
});
group('HEAD Request', () {
@ -317,86 +394,4 @@ void main() {
expect(harCodeGen.getCode(requestModelDelete2, "https"), expectedCode);
});
});
group('Request with enabled Rows', () {
test('Enabled Params', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social?num=8700000&add_space=true",
"httpVersion": "HTTP/1.1",
"queryString": [
{
"name": "num",
"value": "8700000"
},
{
"name": "add_space",
"value": "true"
}
],
"headers": []
}""";
expect(
harCodeGen.getCode(requestModelEnabledParams, "https"), expectedCode);
});
test('Enabled Headers', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social",
"httpVersion": "HTTP/1.1",
"queryString": [],
"headers": [
{
"name": "User-Agent",
"value": "Test Agent"
}
]
}""";
expect(
harCodeGen.getCode(
requestModelEnabledHeaders,
"https",
),
expectedCode);
});
test('Enabled Headers and Params', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social?num=8700000&digits=3",
"httpVersion": "HTTP/1.1",
"queryString": [
{
"name": "num",
"value": "8700000"
},
{
"name": "digits",
"value": "3"
}
],
"headers": [
{
"name": "User-Agent",
"value": "Test Agent"
}
]
}""";
expect(
harCodeGen.getCode(requestModelEnabledRows, "https"), expectedCode);
});
test('Disabled Headders and Params', () {
const expectedCode = r"""{
"method": "GET",
"url": "https://api.foss42.com/humanize/social",
"httpVersion": "HTTP/1.1",
"queryString": [],
"headers": []
}""";
expect(
harCodeGen.getCode(requestModelDisabledRows, "https"), expectedCode);
});
});
}