mirror of
https://github.com/foss42/apidash.git
synced 2025-06-01 06:42:07 +08:00
freezed NameValueModel
This commit is contained in:
@ -2,16 +2,16 @@ import 'package:test/test.dart';
|
||||
import 'package:apidash/models/name_value_model.dart';
|
||||
|
||||
void main() {
|
||||
const kvRow1 = NameValueModel("harry", 23);
|
||||
const kvRow1 = NameValueModel(name: "harry", value: 23);
|
||||
String kvRow1Expected = "{harry: 23}";
|
||||
|
||||
test('Testing toString()', () {
|
||||
expect(kvRow1.toString(), kvRow1Expected);
|
||||
});
|
||||
|
||||
const kvRow2Expected = NameValueModel("winter", "26");
|
||||
const kvRow2Expected = NameValueModel(name: "winter", value: "26");
|
||||
test('Testing copyWith()', () {
|
||||
expect(kvRow1.copyWith(k: "winter", v: "26"), kvRow2Expected);
|
||||
expect(kvRow1.copyWith(name: "winter", value: "26"), kvRow2Expected);
|
||||
});
|
||||
|
||||
test('Testing hashcode', () {
|
||||
|
@ -55,8 +55,9 @@ void main() {
|
||||
url: 'api.foss42.com/case/lower',
|
||||
name: 'foss42 api',
|
||||
requestHeaders: const [
|
||||
NameValueModel('content-length', '18'),
|
||||
NameValueModel('content-type', 'application/json; charset=utf-8')
|
||||
NameValueModel(name: 'content-length', value: '18'),
|
||||
NameValueModel(
|
||||
name: 'content-type', value: 'application/json; charset=utf-8')
|
||||
],
|
||||
requestBodyContentType: ContentType.json,
|
||||
requestBody: '''{
|
||||
@ -71,8 +72,9 @@ void main() {
|
||||
url: 'api.foss42.com/case/lower',
|
||||
name: 'foss42 api',
|
||||
requestHeaders: [
|
||||
NameValueModel('content-length', '18'),
|
||||
NameValueModel('content-type', 'application/json; charset=utf-8')
|
||||
NameValueModel(name: 'content-length', value: '18'),
|
||||
NameValueModel(
|
||||
name: 'content-type', value: 'application/json; charset=utf-8')
|
||||
],
|
||||
requestBodyContentType: ContentType.json,
|
||||
requestBody: '''{
|
||||
|
Reference in New Issue
Block a user