Skip to content

Instantly share code, notes, and snippets.

@marcos-bah
Created May 27, 2021 21:28
Show Gist options
  • Save marcos-bah/09e22105301d5a292752f56a3f578012 to your computer and use it in GitHub Desktop.
Save marcos-bah/09e22105301d5a292752f56a3f578012 to your computer and use it in GitHub Desktop.
import 'package:common/common.dart';
import 'package:test/test.dart';
void main() {
test('from json to json', () {
final json = {
'name': 'Joao',
'room': 'sala 1',
'text': '',
'type': 'SocketEventType.enter_room',
};
final event = SocketEvent.fromJson(json);
expect(event.name, 'Joao');
expect(event.type, SocketEventType.enter_room);
expect(event.toJson(), json);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment