Skip to content

Commit

Permalink
reorganizing folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Leocardoso94 committed Oct 13, 2019
1 parent 194e2be commit b3cfe77
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
24 changes: 24 additions & 0 deletions test/services/correios_test.dart
@@ -0,0 +1,24 @@
import 'package:cep_future/enum.dart';
import 'package:cep_future/services/correios.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
test('fetchCorreiosService success', () async {
final cep = await fetchCorreiosService('05653070');

expect(cep.city, 'São Paulo');
expect(cep.cep, '05653070');
expect(cep.neighborhood, 'Jardim Leonor');
expect(cep.state, 'SP');
expect(cep.street, 'Praça Roberto Gomes Pedrosa');
});

test('fetchCorreiosService error', () async {
try {
await fetchCorreiosService('11111111');
} catch (e) {
expect(e.message, 'CEP INVÁLIDO');
expect(e.service, Service.Correios);
}
});
}
@@ -1,5 +1,4 @@
import 'package:cep_future/enum.dart';
import 'package:cep_future/services/correios.dart';
import 'package:cep_future/services/via_cep.dart';
import 'package:flutter_test/flutter_test.dart';

Expand Down Expand Up @@ -30,23 +29,4 @@ void main() {
expect(e.service, Service.ViaCEP);
}
});

test('fetchCorreiosService success', () async {
final cep = await fetchCorreiosService('05653070');

expect(cep.city, 'São Paulo');
expect(cep.cep, '05653070');
expect(cep.neighborhood, 'Jardim Leonor');
expect(cep.state, 'SP');
expect(cep.street, 'Praça Roberto Gomes Pedrosa');
});

test('fetchCorreiosService error', () async {
try {
await fetchCorreiosService('11111111');
} catch (e) {
expect(e.message, 'CEP INVÁLIDO');
expect(e.service, Service.Correios);
}
});
}

0 comments on commit b3cfe77

Please sign in to comment.