Update settings_model_test.dart

This commit is contained in:
Ashita Prasad
2024-02-08 06:08:22 +05:30
parent 5bdbb0b101
commit 40021954a4

View File

@ -12,6 +12,7 @@ void main() {
defaultUriScheme: "http", defaultUriScheme: "http",
defaultCodeGenLang: CodegenLanguage.curl, defaultCodeGenLang: CodegenLanguage.curl,
saveResponses: true, saveResponses: true,
promptBeforeClosing: true,
); );
test('Testing toJson()', () { test('Testing toJson()', () {
@ -25,6 +26,7 @@ void main() {
"defaultUriScheme": "http", "defaultUriScheme": "http",
"defaultCodeGenLang": "curl", "defaultCodeGenLang": "curl",
"saveResponses": true, "saveResponses": true,
"promptBeforeClosing": true
}; };
expect(sm.toJson(), expectedResult); expect(sm.toJson(), expectedResult);
}); });
@ -40,6 +42,7 @@ void main() {
"defaultUriScheme": "http", "defaultUriScheme": "http",
"defaultCodeGenLang": "curl", "defaultCodeGenLang": "curl",
"saveResponses": true, "saveResponses": true,
"promptBeforeClosing": true
}; };
expect(SettingsModel.fromJson(input), sm); expect(SettingsModel.fromJson(input), sm);
}); });
@ -53,6 +56,7 @@ void main() {
defaultUriScheme: "http", defaultUriScheme: "http",
defaultCodeGenLang: CodegenLanguage.curl, defaultCodeGenLang: CodegenLanguage.curl,
saveResponses: false, saveResponses: false,
promptBeforeClosing: true,
); );
expect( expect(
sm.copyWith( sm.copyWith(
@ -64,7 +68,7 @@ void main() {
test('Testing toString()', () { test('Testing toString()', () {
const expectedResult = const expectedResult =
"{isDark: false, alwaysShowCollectionPaneScrollbar: true, width: 300.0, height: 200.0, dx: 100.0, dy: 150.0, defaultUriScheme: http, defaultCodeGenLang: curl, saveResponses: true}"; "{isDark: false, alwaysShowCollectionPaneScrollbar: true, width: 300.0, height: 200.0, dx: 100.0, dy: 150.0, defaultUriScheme: http, defaultCodeGenLang: curl, saveResponses: true, promptBeforeClosing: true}";
expect(sm.toString(), expectedResult); expect(sm.toString(), expectedResult);
}); });