UnitTest example for asynchronous code
问题 After reading the Unit Testing with Dart somehow I'm still can not understand how to use it with Future s. For example: void main() { group('database group',(){ setUp( () { // Setup }); tearDown((){ // TearDown }); test('open connection to local database', (){ DatabaseBase database = null; expect(database = new MongoDatabase("127.0.0.8", "simplechat-db"), isNotNull); database.AddMessage(null).then( (e) { expectAsync1(e) { // All ok } }, onError: (err) { expectAsync1(bb) { fail('error !'); } }