freezed NameValueModel

This commit is contained in:
Ashita Prasad
2023-08-28 09:41:26 +05:30
parent d51465a1d1
commit 867f6e979c
15 changed files with 373 additions and 86 deletions

View File

@@ -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', () {