forked from eatvio/eatvio_app
feat(dependencies): add rxdart package and improve string extension methods for better handling of empty strings and gender parsing
This commit is contained in:
38
test/features/chat/models/websocket_info_model_test.dart
Normal file
38
test/features/chat/models/websocket_info_model_test.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:eatvio_app/features/chat/models/websocket_info_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('WebsocketInfoModel', () {
|
||||
test('создает WebsocketInfoModel с правильными значениями', () {
|
||||
const model = WebsocketInfoModel(
|
||||
key: 'test-key',
|
||||
host: 'localhost',
|
||||
port: '6001',
|
||||
cluster: 'mt1',
|
||||
userId: 123,
|
||||
);
|
||||
|
||||
expect(model.key, 'test-key');
|
||||
expect(model.host, 'localhost');
|
||||
expect(model.port, '6001');
|
||||
expect(model.cluster, 'mt1');
|
||||
expect(model.userId, 123);
|
||||
});
|
||||
|
||||
test('fromJson создает WebsocketInfoModel из JSON', () {
|
||||
final json = {
|
||||
'key': 'test-key',
|
||||
'host': 'localhost',
|
||||
'port': '6001',
|
||||
'cluster': 'mt1',
|
||||
'user_id': 123,
|
||||
};
|
||||
|
||||
final model = WebsocketInfoModel.fromJson(json);
|
||||
|
||||
expect(model.key, 'test-key');
|
||||
expect(model.userId, 123);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user