Skip to content

Commit

Permalink
feat(phone): added new phone number
Browse files Browse the repository at this point in the history
  • Loading branch information
payam-zahedi committed Nov 27, 2022
1 parent 6ad4050 commit 12f2e13
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/src/constants/phone_number/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ const MCI = {
type: SimCardType.credit,
operator: Operator.MCI,
),
'995': OperatorDetail(
provinces: [],
base: 'کشوری',
type: SimCardType.credit,
operator: Operator.MCI,
),
'996': OperatorDetail(
provinces: [],
base: 'کشوری',
type: SimCardType.credit,
operator: Operator.MCI,
),
};

const taliya = {
Expand Down Expand Up @@ -140,6 +152,7 @@ const defaultIrancellModel = OperatorDetail(
);

const irancell = {
'900': defaultIrancellModel,
'930': defaultIrancellModel,
'933': defaultIrancellModel,
'935': defaultIrancellModel,
Expand Down
12 changes: 12 additions & 0 deletions test/test_phone_number.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ void main() {
expect(number3?.operator?.name, 'ایرانسل');
expect(number3?.type, SimCardType.both);

final number4 = getPhoneNumberDetail('09960880440');

expect(number4?.base, 'کشوری');
expect(number4?.operator?.name, 'همراه اول');
expect(number4?.type, SimCardType.credit);

final number5 = getPhoneNumberDetail('09000880440');

expect(number5?.base, 'کشوری');
expect(number5?.operator?.name, 'ایرانسل');
expect(number5?.type, SimCardType.both);

expect(getPhoneNumberDetail('09022002580')?.provinces?.length ?? 0, 0);

/// Should return null, because it's not an iranian phone number
Expand Down

0 comments on commit 12f2e13

Please sign in to comment.