title: Flutter BLoC Testing
body: <p>I am using the flutter_bloc library and trying to do unit testing.
  I am doing this pretty much as explained in <a href="https://medium.com/flutter-community/unit-testing-with-bloc-b94de9655d86" rel="nofollow noreferrer">this tutorial</a> and it's doing fine. </p>
  
  <p>However, if a BlocState which extends Equatable (which required) has many properties or large list of items which extends Equatable, as well with their props[] defined as required. </p>
  
  <p>This makes hard for the <code>expectLater()</code> to match proper emitted states because it tries to match the exact instance with its content and not only the state type or instance of.</p>
  
  <p>For example: </p>
  
  <p>Consider the following State class:</p>
  
  <pre><code>class BlocState extends Equatable{
       final List&lt;String&gt; data;
       BlocState({this.data});
  
       @override
       List&lt;Object&gt; get props =&gt; [data];
  }
  </code></pre>
  
  <p>Then for emitted state like this:</p>
  
  <pre><code>List&lt;String&gt; data = ['Mark', 'Mike', 'John']
  BlocState({data: data}); 
  </code></pre>
  
  <p>This expectLater will fail  </p>
  
  <pre><code> expectLater(
      bloc,
      emitsInOrder([BlocState(),]), //This will fail as the state does't equals exactly to the real state
    )
  </code></pre>
  
  <p>And this one will pass: </p>
  
  <pre><code>expectLater(
      bloc,
      emitsInOrder([BlocState(data: ['Mark', 'Mike', 'John']),]), //This will pass 
    )
  </code></pre>
  
  <p>On such simple state it's fine to verify exact content, but if the list will have 100 items how it can be tested?</p>
  
  <p>Is there a way to verify just the instance type without the content?</p>