gudii9
asked on
junit testing
Hi,
I followed
https://www.youtube.com/watch?v=v2F49zLLj-8
i wrote above junit tests, suite all works perfect with simple int and strings. When it comes to unit testing complex objects in real time projects involving multiple layers, services with mock objects i am not completely confident in those scenarios. Are there any good similar video tutorials on those advanced junit topics. Any good material, resources to go learn practically step by step. Please advise
I followed
https://www.youtube.com/watch?v=v2F49zLLj-8
package test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({ ConcateTest.class, MultiplyTest.class })
public class AllTests {
}
package test;
import static org.junit.Assert.*;
import org.junit.Test;
public class ConcateTest {
@Test
public void testConcat() {
Junit junit=new Junit();
String result=junit.concatenate("aa", "bc");
assertEquals("aabc", result);
}
}
package test;
public class Junit {
public String concatenate(String one, String two)
{
return one+two;
}
public int multiply(int number1, int number2)
{
return number1*number2;
}
}
package test;
import static org.junit.Assert.*;
import org.junit.Test;
public class MultiplyTest {
@Test
public void testMultiply() {
Junit junit=new Junit();
int result=junit.multiply(3, 6);
assertEquals(18, result);
}
}
i wrote above junit tests, suite all works perfect with simple int and strings. When it comes to unit testing complex objects in real time projects involving multiple layers, services with mock objects i am not completely confident in those scenarios. Are there any good similar video tutorials on those advanced junit topics. Any good material, resources to go learn practically step by step. Please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.