Skip to content

Commit

Permalink
added testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanrajpathak committed Apr 4, 2024
1 parent ac51776 commit e261948
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/src/ip_address_base_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ void main() {
expect(city, isNotNull);
expect(city, geoIpJson["city"]);
});

test("getContinentCode", () async {
when(() => repository.getContinentCode())
.thenAnswer((_) async => geoIpJson["continent_code"]);
String city = await repository.getContinentCode();
expect(city, isNotNull);
expect(city, geoIpJson["continent_code"]);
});
test("getContinentCodeFor", () async {
when(() => repository.getContinentCodeFor(geoIpJson["ip"]))
.thenAnswer((_) async => geoIpJson["continent_code"]);
String city = await repository.getContinentCodeFor(geoIpJson["ip"]);
expect(city, isNotNull);
expect(city, geoIpJson["continent_code"]);
});
test("getSeeIp", () async {
when(() => repository.getSeeIp("ip")).thenAnswer((_) async => testIP);
String ip = await repository.getSeeIp("ip");
Expand Down

0 comments on commit e261948

Please sign in to comment.