From 194e2be13d90407b37aef43612a370354a088502 Mon Sep 17 00:00:00 2001 From: Leonardo Cardoso Date: Sun, 13 Oct 2019 10:47:44 -0300 Subject: [PATCH] validateInputLength test --- test/cep_future_test.dart | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/cep_future_test.dart b/test/cep_future_test.dart index 3898ef0..0ffaf09 100644 --- a/test/cep_future_test.dart +++ b/test/cep_future_test.dart @@ -16,13 +16,18 @@ void main() { expect(removeSpecialCharacters('-055-16,'), '05516'); }); - // test('validateInputLength', () { - // expect(validateInputLength('12345'), '12345'); - // expect( - // validateInputLength('12345121212'), - // instamce(matcher), - // ); - // }); + test('validateInputLength', () { + expect(validateInputLength('12345'), '12345'); + expect(validateInputLength('12345678'), '12345678'); + }); + + test('validateInputLength error', () { + try { + validateInputLength('123456789'); + } catch (e) { + expect(e.message, 'CEP deve conter exatamente 8 caracteres.'); + } + }); test('leftPadWithZeros', () { expect(leftPadWithZeros('05516'), '00005516');