Created
May 27, 2021 21:28
-
-
Save marcos-bah/09e22105301d5a292752f56a3f578012 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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