rename package folders

This commit is contained in:
Salvatore Giordano
2021-02-01 15:45:58 +01:00
parent 6682ad5e8b
commit 964a428f2e
445 changed files with 1 additions and 343 deletions
@@ -0,0 +1,40 @@
import 'package:stream_chat/src/models/command.dart';
import 'dart:convert';
import 'package:test/test.dart';
void main() {
group('src/models/command', () {
const jsonExample = '''
{
"name": "giphy",
"description": "Post a random gif to the channel",
"args": "[text]"
}
''';
test('should parse json correctly', () {
final command = Command.fromJson(json.decode(jsonExample));
expect(command.name, 'giphy');
expect(command.description, 'Post a random gif to the channel');
expect(command.args, '[text]');
});
test('should serialize to json correctly', () {
final command = Command(
name: 'giphy',
description: 'Post a random gif to the channel',
args: '[text]',
);
expect(
command.toJson(),
{
"name": "giphy",
"description": "Post a random gif to the channel",
"args": "[text]",
},
);
});
});
}