|
| 1 | +// Copyright 2025 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +import 'package:flutter/material.dart'; |
| 16 | +import 'package:flutter_test/flutter_test.dart'; |
| 17 | +import 'package:google_navigation_flutter/google_navigation_flutter.dart'; |
| 18 | + |
| 19 | +void main() { |
| 20 | + group('TermsAndConditionsUIParams tests', () { |
| 21 | + test('converts to DTO correctly with all parameters', () { |
| 22 | + const params = TermsAndConditionsUIParams( |
| 23 | + backgroundColor: Color(0xFFFFFFFF), |
| 24 | + titleColor: Color(0xFF1976D2), |
| 25 | + mainTextColor: Color(0xFF212121), |
| 26 | + acceptButtonTextColor: Color(0xFF4CAF50), |
| 27 | + cancelButtonTextColor: Color(0xFFF44336), |
| 28 | + ); |
| 29 | + |
| 30 | + final dto = params.toDto(); |
| 31 | + |
| 32 | + expect(dto.backgroundColor, 0xFFFFFFFF); |
| 33 | + expect(dto.titleColor, 0xFF1976D2); |
| 34 | + expect(dto.mainTextColor, 0xFF212121); |
| 35 | + expect(dto.acceptButtonTextColor, 0xFF4CAF50); |
| 36 | + expect(dto.cancelButtonTextColor, 0xFFF44336); |
| 37 | + }); |
| 38 | + |
| 39 | + test('converts to DTO correctly with null parameters', () { |
| 40 | + const params = TermsAndConditionsUIParams(); |
| 41 | + |
| 42 | + final dto = params.toDto(); |
| 43 | + |
| 44 | + expect(dto.backgroundColor, null); |
| 45 | + expect(dto.titleColor, null); |
| 46 | + expect(dto.mainTextColor, null); |
| 47 | + expect(dto.acceptButtonTextColor, null); |
| 48 | + expect(dto.cancelButtonTextColor, null); |
| 49 | + }); |
| 50 | + }); |
| 51 | +} |
0 commit comments