File size: 831 Bytes
b225a21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import 'package:auto_gpt_flutter_client/models/task_request_body.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  group('TaskRequestBody', () {
    test('should create TaskRequestBody with correct values', () {
      final taskRequestBody = TaskRequestBody(
          input: 'Do something', additionalInput: {'key': 'value'});

      expect(taskRequestBody.input, 'Do something');
      expect(taskRequestBody.additionalInput, {'key': 'value'});
    });

    test('should convert TaskRequestBody to correct JSON', () {
      final taskRequestBody = TaskRequestBody(
          input: 'Do something', additionalInput: {'key': 'value'});

      final json = taskRequestBody.toJson();

      expect(json, {
        'input': 'Do something',
        'additional_input': {'key': 'value'}
      });
    });
  });
}