In this video, it shows the steps to create java unit test for static methods of Android Studio Project.
I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: programmerworld1990@gmail.com
Complete source code and other details/ steps of this video are posted in the below link:
https://programmerworld.co/android/ho...
However, the main Java code is copied below also for reference:
package com.programmerworld.unittestsforstaticmethod;
import org.junit.Test;
import static org.junit.Assert.*;
public class ExampleUnitTest {
private MainActivity activity;
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
@Test
public void testStaticAdditionMethod(){
double result = activity.staticAdditionMethod(4,5);
assertEquals(9,result,0.0001);
}
}
--
Sur cette page du site, vous pouvez voir la vidéo en ligne How to write unit tests for java static methods in Android Studio project? durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Programmer World 12 mai 2024, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 186 fois et il a aimé 3 téléspectateurs. Bon visionnage!