title: flutter: compare two object and got ERROR: Expected: VenuesDetails:<VenuesDetails> in unit test
body: <p>I am using Equatable to compare 2 object in unit testing.This is my object that extended from Equatable:</p>
  
  <pre><code>import 'dart:convert';
  
  import 'package:equatable/equatable.dart';
  
  class VenuesDetails extends Equatable {
    Response response;
  
    VenuesDetails({
      this.response,
    });
  
    factory VenuesDetails.fromJson(Map&lt;String, dynamic&gt; json) =&gt; VenuesDetails(
          response: Response.fromJson(json["response"]),
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "response": response.toJson(),
        };
  
    @override
    List&lt;Object&gt; get props =&gt; [response];
  }
  
  class Response extends Equatable {
    Venue venue;
  
    Response({
      this.venue,
    });
  
    factory Response.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Response(
          venue: Venue.fromJson(json["venue"]),
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "venue": venue.toJson(),
        };
  
    @override
    List&lt;Object&gt; get props =&gt; [venue];
  }
  
  class Venue extends Equatable {
    String id;
    String name;
    Contact contact;
    Location location;
    String canonicalUrl;
    List&lt;Category&gt; categories;
    int createdAt;
    String shortUrl;
    String timeZone;
  
    Venue({
      this.id,
      this.name,
      this.contact,
      this.location,
      this.canonicalUrl,
      this.categories,
      this.createdAt,
      this.shortUrl,
      this.timeZone,
    });
  
    factory Venue.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Venue(
          id: json["id"],
          name: json["name"],
          contact: Contact.fromJson(json["contact"]),
          location: Location.fromJson(json["location"]),
          canonicalUrl: json["canonicalUrl"],
          categories: List&lt;Category&gt;.from(
              json["categories"].map((x) =&gt; Category.fromJson(x))),
          createdAt: json["createdAt"],
          shortUrl: json["shortUrl"],
          timeZone: json["timeZone"],
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "id": id,
          "name": name,
          "contact": contact.toJson(),
          "location": location.toJson(),
          "canonicalUrl": canonicalUrl,
          "categories": List&lt;dynamic&gt;.from(categories.map((x) =&gt; x.toJson())),
          "createdAt": createdAt,
          "shortUrl": shortUrl,
          "timeZone": timeZone,
        };
  
    @override
    List&lt;Object&gt; get props =&gt; [
          id,
          name,
          contact,
          location,
          canonicalUrl,
          categories,
          createdAt,
          shortUrl,
          timeZone,
        ];
  }
  
  class Category extends Equatable {
    String id;
    String name;
    String pluralName;
    String shortName;
    Icon icon;
    bool primary;
  
    Category({
      this.id,
      this.name,
      this.pluralName,
      this.shortName,
      this.icon,
      this.primary,
    });
  
    factory Category.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Category(
          id: json["id"],
          name: json["name"],
          pluralName: json["pluralName"],
          shortName: json["shortName"],
          icon: Icon.fromJson(json["icon"]),
          primary: json["primary"],
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "id": id,
          "name": name,
          "pluralName": pluralName,
          "shortName": shortName,
          "icon": icon.toJson(),
          "primary": primary,
        };
  
    @override
    List&lt;Object&gt; get props =&gt; [
          id,
          name,
          pluralName,
          shortName,
          icon,
          primary,
        ];
  }
  
  class Icon extends Equatable {
    String prefix;
    String suffix;
  
    Icon({
      this.prefix,
      this.suffix,
    });
  
    factory Icon.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Icon(
          prefix: json["prefix"],
          suffix: json["suffix"],
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "prefix": prefix,
          "suffix": suffix,
        };
  
    @override
    List&lt;Object&gt; get props =&gt; [
          prefix,
          suffix,
        ];
  }
  
  class Contact extends Equatable {
    Contact();
  
    factory Contact.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Contact();
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {};
  
    @override
    List&lt;Object&gt; get props =&gt; [];
  }
  
  class Location extends Equatable {
    double lat;
    double lng;
    List&lt;LabeledLatLng&gt; labeledLatLngs;
    String cc;
    String country;
    List&lt;String&gt; formattedAddress;
  
    Location({
      this.lat,
      this.lng,
      this.labeledLatLngs,
      this.cc,
      this.country,
      this.formattedAddress,
    });
  
    factory Location.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Location(
          lat: json["lat"].toDouble(),
          lng: json["lng"].toDouble(),
          labeledLatLngs: List&lt;LabeledLatLng&gt;.from(
              json["labeledLatLngs"].map((x) =&gt; LabeledLatLng.fromJson(x))),
          cc: json["cc"],
          country: json["country"],
          formattedAddress:
              List&lt;String&gt;.from(json["formattedAddress"].map((x) =&gt; x)),
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "lat": lat,
          "lng": lng,
          "labeledLatLngs":
              List&lt;dynamic&gt;.from(labeledLatLngs.map((x) =&gt; x.toJson())),
          "cc": cc,
          "country": country,
          "formattedAddress": List&lt;dynamic&gt;.from(formattedAddress.map((x) =&gt; x)),
        };
  
    @override
    List&lt;Object&gt; get props =&gt; [
          lat,
          lng,
          labeledLatLngs,
          cc,
          country,
          formattedAddress,
        ];
  }
  
  class LabeledLatLng extends Equatable {
    String label;
    double lat;
    double lng;
  
    LabeledLatLng({
      this.label,
      this.lat,
      this.lng,
    });
  
    factory LabeledLatLng.fromJson(Map&lt;String, dynamic&gt; json) =&gt; LabeledLatLng(
          label: json["label"],
          lat: json["lat"].toDouble(),
          lng: json["lng"].toDouble(),
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "label": label,
          "lat": lat,
          "lng": lng,
        };
  
    @override
    List&lt;Object&gt; get props =&gt; [
          label,
          lat,
          lng,
        ];
  }
  </code></pre>
  
  <p>I write this test to get data from remote repository :</p>
  
  <p>test(
    'should perform a get request when the response code is 200 (success)',
    () async {</p>
  
  <pre><code>when(mockHttpCLient.get(any, headers: anyNamed('headers'))).thenAnswer(
      (_) async =&gt; http.Response(fixture('venues_details.json'), 200));
  
  final result = await foursquareRepositoryImpl.getVenuesDetails(venueId);
  
  expect(result, venue);
    },
  );
  </code></pre>
  
  <p>But in <code>expect(result, venue);</code> i got this error:</p>
  
  <pre><code> getVenuesDetails should perform a get request when the response code is 200 (success):
  
  ERROR: Expected: VenuesDetails:&lt;VenuesDetails&gt;
    Actual: VenuesDetails:&lt;VenuesDetails&gt;
  
  package:test_api                                            expect
  package:flutter_test/src/widget_tester.dart 234:3           expect
  test/repository/foursquare_repository_impl_test.dart 110:9  main.&lt;fn&gt;.&lt;fn&gt;
  </code></pre>
  
  <p>Where is my mistake to use <code>Equatable</code> ?</p>