Skip to content

Instantly share code, notes, and snippets.

@moopat
Last active January 21, 2016 06:49
Show Gist options
  • Save moopat/681eba3973ff864d23d0 to your computer and use it in GitHub Desktop.
Save moopat/681eba3973ff864d23d0 to your computer and use it in GitHub Desktop.
Instead of "This message is longer than 57 characters, it has 107 characters, and is therefore not received completely." the genymotion device the test is run on receives the following message: "This message is longer than 57 characters, it has 107 cha"
package genytest;
import android.support.test.InstrumentationRegistry;
import android.test.InstrumentationTestCase;
import com.genymotion.api.GenymotionManager;
public class GenymotionMessageTest extends InstrumentationTestCase {
private GenymotionManager geny;
@Override
protected void setUp() throws Exception {
super.setUp();
injectInstrumentation(InstrumentationRegistry.getInstrumentation());
if(GenymotionManager.isGenymotionDevice()){
geny = GenymotionManager.getGenymotionManager(getInstrumentation().getTargetContext());
}
}
public void testMessage(){
if (geny == null) {
return;
}
final String phone = "+436641234567";
final String message = "This message is longer than 57 characters, it has 107 characters, and is therefore not received completely.";
/*
* The message that is received by the genymotion device is "This message is longer than 57 characters, it has 107 cha".
*/
geny.getRadio().sendSms(phone, message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment