-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Labels
Description
Hello, this is my test.
test('Join assembly post a join request in server', () {
FakeAsync().run((async) async {
final membersDao = MockAssemblyMembersDao();
final membersApiClient = MockAssemblyMembersApiClient();
final assemblyRequestDao = MockAssemblyJoin RequestsDao();
final userDao = MockUserDao();
when(() => membersApiClient.postJoinRequest(any())).thenAnswer(
(invocation) => Future(
() => HttpResponse(
'',
Response(
requestOptions: RequestOptions(
path: '',
), // RequestOptions
statusCode: 201), // Response
), // HttpResponse
), // Future
);
final membersRepository = AssemblyMembersRepository(
assemblyMembersDao: membersDao,
assemblyMembersApiClient: membersApiClient,
assemblyJoinRequestsDao: assemblyRequestDao,
userDao: userDao);
var result = await membersRepository.postJoinRequest('uuid');
expect(result, isA>());
});
);
And this is the not yet implemented method:
Future<Either<RestFailure, Assembly>> postJoinRequest(String uuidCode) async {
throw UnimplementedError();
}
The test unexpectedly pass instead to show me an error and mark itself red.