title: how do I unit test with multiple expect
body: <p>The unit test I write below doesn't work when there are 3 expect, how can I rewrite the unit test below:</p>
  <pre><code>test('400 bad response', () async {
    when(
      () =&gt; sampleClient.getTransaction(
          '1'),
    ).thenThrow(DioError(
        response: Response(
            statusCode: 400,
            data: badRepsonseJson,
            requestOptions: RequestOptions(path: '')),
        requestOptions: RequestOptions(path: '')));
    final call = sampleService.getTransactionByHash(
        '1');
  
    expect(() =&gt; call, throwsA(TypeMatcher&lt;SampleException&gt;())); // Expect 1
    try {
      await sampleService.getTransactionByHash(
          '1');
    } on SampleException catch (e) {
      expect(e.errorCode, badResponse.statusCode); // Expect 2
      expect(e.message, badResponse.message); // Expect 3
    }
  });
  </code></pre>