Shrikanth Kalluraya
Shrikanth Kalluraya

Reputation: 1119

Start a service within a TestCase in android

How to start/bind a service from a test case. I tried using the ServiceTestCase it doesnt work

Upvotes: 0

Views: 965

Answers (1)

inazaruk
inazaruk

Reputation: 74790

From ServiceTestCase documentation:

When one of your test methods calls ServiceTestCase.startService() or ServiceTestCase.bindService(), the test case calls Service.onCreate() and then calls either Service.startService(Intent) or Service.bindService(Intent, ServiceConnection, int), as appropriate. It also stores values needed to track and support the lifecycle.

Upvotes: 2

Related Questions