mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-09-13 12:03:18 +00:00
package
This commit is contained in:
31
test/esiur_test.dart
Normal file
31
test/esiur_test.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:esiur/esiur.dart';
|
||||
|
||||
void main() {
|
||||
test('adds one to input values', () {
|
||||
connect();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
connect() async
|
||||
{
|
||||
// connect to the server
|
||||
var x = await Warehouse.get("iip://localhost:5000/db/my", {"username": "demo", "password": "1234"});
|
||||
|
||||
// get property
|
||||
print(x.Level);
|
||||
// listen to event
|
||||
x.on("LevelUp", (v,y,z)=>print("Level up ${v} ${y}${z}"));
|
||||
// use await
|
||||
print("Added successfully ${await x.Add(40)}");
|
||||
// use named arguments
|
||||
print(await x.Add(value: 20));
|
||||
// test chunks
|
||||
x.Stream(10).chunk((c)=>print(c));
|
||||
// property setter
|
||||
x.Level += 900;
|
||||
|
||||
print("Done");
|
||||
|
||||
}
|
Reference in New Issue
Block a user