diff options
author | Allan Wang <me@allanwang.ca> | 2017-08-03 15:18:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 15:18:20 -0700 |
commit | bafc1996d803862d30a2c7d0c402d30c79c4f647 (patch) | |
tree | 5456960a330d7890ac43e1193a80f1db670a8b06 /core/src/androidTest/kotlin/ca | |
parent | 84b9d3b40e342dc7715c5af13d102bb98529b0fb (diff) | |
download | kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.tar.gz kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.tar.bz2 kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.zip |
3.2.2 - Create faq parser and update sample (#19)3.2.3
* Test emulator
* Update readme
* Update fastadapter and about listing
* Make faq parser asynchronous
* Modularize about panels
* Add basis for faq
* Test and finalize the faq panel
* Update readme
* Update changelog
* Remove emulator for now
* Update sample
Diffstat (limited to 'core/src/androidTest/kotlin/ca')
-rw-r--r-- | core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt b/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt index 94d1330..1b185f3 100644 --- a/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt +++ b/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt @@ -17,22 +17,26 @@ class FaqTest { @Test fun simpleTest() { - val data = InstrumentationRegistry.getTargetContext().kauParseFaq(R.xml.test_faq) - assertEquals(2, data.size, "FAQ size is incorrect") - assertEquals("1. This is a question", data.first().first.toString(), "First question does not match") - assertEquals("This is an answer", data.first().second.toString(), "First answer does not match") - assertEquals("2. This is another question", data.last().first.toString(), "Second question does not match") - assertEquals("This is another answer", data.last().second.toString(), "Second answer does not match") + InstrumentationRegistry.getTargetContext().kauParseFaq(R.xml.test_faq) { + data -> + assertEquals(2, data.size, "FAQ size is incorrect") + assertEquals("1. This is a question", data.first().first.toString(), "First question does not match") + assertEquals("This is an answer", data.first().second.toString(), "First answer does not match") + assertEquals("2. This is another question", data.last().first.toString(), "Second question does not match") + assertEquals("This is another answer", data.last().second.toString(), "Second answer does not match") + } } @Test fun withoutNumbering() { - val data = InstrumentationRegistry.getTargetContext().kauParseFaq(R.xml.test_faq, false) - assertEquals(2, data.size, "FAQ size is incorrect") - assertEquals("This is a question", data.first().first.toString(), "First question does not match") - assertEquals("This is an answer", data.first().second.toString(), "First answer does not match") - assertEquals("This is another question", data.last().first.toString(), "Second question does not match") - assertEquals("This is another answer", data.last().second.toString(), "Second answer does not match") + InstrumentationRegistry.getTargetContext().kauParseFaq(R.xml.test_faq, false) { + data -> + assertEquals(2, data.size, "FAQ size is incorrect") + assertEquals("This is a question", data.first().first.toString(), "First question does not match") + assertEquals("This is an answer", data.first().second.toString(), "First answer does not match") + assertEquals("This is another question", data.last().first.toString(), "Second question does not match") + assertEquals("This is another answer", data.last().second.toString(), "Second answer does not match") + } } }
\ No newline at end of file |