Friday 28 June 2013

Asserting Toast message using Robolectric | Testing Toast message Android

Hello Friends,
Today , I am sharing my another android tutorial. In this tutorial I am going to show
how to write the test case for android Toast message using Roboelectric and Junit.

 public void testToastMesaage() throws Exception{
     assertThat( ShadowToast.getTextOfLatestToast(),equalTo(


Mukesh Kumar

Hi Guys I am from Delhi working as Web/Mobile Application Developer(Android Developer), also have knowledge of Roboelctric and Mockito ,android test driven development... Blogging has been my passion and I think blogging is one of the powerful medium to share knowledge and ideas....


  1. Could you please help me with this problem I have?

    I haven't find any solution. I'm using mockito.



Copyright @ 2013 Android Developers Blog.