Modify the tests to cover subsequent stop issues
This commit is contained in:
parent
89475d0919
commit
49bf4598ff
|
@ -17,7 +17,7 @@ import org.junit.Assert.*
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
* See [testing documentation](http://d.android.com/tools/testing).
|
||||||
*/
|
*/
|
||||||
@RunWith(AndroidJUnit4::class)
|
@RunWith(AndroidJUnit4::class)
|
||||||
class ExampleInstrumentedTest {
|
class OuinetInstrumentedTest {
|
||||||
@Test
|
@Test
|
||||||
fun useAppContext() {
|
fun useAppContext() {
|
||||||
// Context of the app under test.
|
// Context of the app under test.
|
||||||
|
@ -36,16 +36,24 @@ class ExampleInstrumentedTest {
|
||||||
var ouinet = Ouinet(appContext, config)
|
var ouinet = Ouinet(appContext, config)
|
||||||
|
|
||||||
for (i in 1..5) {
|
for (i in 1..5) {
|
||||||
ouinet.start()
|
|
||||||
ouinet.start()
|
ouinet.start()
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
assertEquals("Starting", ouinet.state.toString());
|
assertTrue(ouinet.state.toString().startsWith("Start"))
|
||||||
|
|
||||||
ouinet.stop()
|
|
||||||
ouinet.stop()
|
ouinet.stop()
|
||||||
assertEquals("Stopped", ouinet.state.toString());
|
assertEquals("Stopped", ouinet.state.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i in 1..3) {
|
||||||
|
Thread.sleep(100);
|
||||||
|
ouinet.stop()
|
||||||
|
assertEquals("Stopped", ouinet.state.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
ouinet.start()
|
||||||
|
Thread.sleep(1000);
|
||||||
|
assertTrue(ouinet.state.toString().startsWith("Start"))
|
||||||
ouinet.stop()
|
ouinet.stop()
|
||||||
|
assertEquals("Stopped", ouinet.state.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user