mirror of
https://github.com/mueller-ma/PrepaidBalance.git
synced 2024-09-20 00:12:15 +02:00
parent
fab4399221
commit
4ee88a7fe6
@ -26,6 +26,9 @@ class ResponseParser {
|
|||||||
Matcher("Generic PLN", "^(.*?)((\\d)+\\.(\\d){1,2}) PLN(.*?)\$".toRegex()) { groups ->
|
Matcher("Generic PLN", "^(.*?)((\\d)+\\.(\\d){1,2}) PLN(.*?)\$".toRegex()) { groups ->
|
||||||
return@Matcher parseRegexGroupAsDouble(groups, 2)
|
return@Matcher parseRegexGroupAsDouble(groups, 2)
|
||||||
},
|
},
|
||||||
|
Matcher("Generic CHF", "^(.*?)((\\d)+\\.(\\d){1,2}) CHF(.*?)\$".toRegex()) { groups ->
|
||||||
|
return@Matcher parseRegexGroupAsDouble(groups, 2)
|
||||||
|
},
|
||||||
Matcher("Generic", "^(.*?)((\\d)+\\.?(\\d)?(\\d)?)(.*)\$".toRegex()) { groups ->
|
Matcher("Generic", "^(.*?)((\\d)+\\.?(\\d)?(\\d)?)(.*)\$".toRegex()) { groups ->
|
||||||
return@Matcher parseRegexGroupAsDouble(groups, 2)
|
return@Matcher parseRegexGroupAsDouble(groups, 2)
|
||||||
},
|
},
|
||||||
|
5
app/src/main/res/values-mcc228-mnc002/strings.xml
Normal file
5
app/src/main/res/values-mcc228-mnc002/strings.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Sunrise Switzerland -->
|
||||||
|
<string name="ussd_code_default" translatable="false">*121#</string>
|
||||||
|
</resources>
|
@ -95,5 +95,11 @@ class ResponseParserTest {
|
|||||||
56.78,
|
56.78,
|
||||||
ResponseParser.getBalance("Current plan active until 08/10/2022 and will renew for \$12.34. Account Balance \$56.78. Add money by dialing *233 or redeem a refill card.")
|
ResponseParser.getBalance("Current plan active until 08/10/2022 and will renew for \$12.34. Account Balance \$56.78. Add money by dialing *233 or redeem a refill card.")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Sunrise Switzerland
|
||||||
|
assertEquals(
|
||||||
|
12.34,
|
||||||
|
ResponseParser.getBalance("Ihr Guthaben beträgt CHF 12.34")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user