Skip to content

Instantly share code, notes, and snippets.

@afawcett
Created May 5, 2013
Embed
What would you like to do?
Reproduction of Salesforce code coverage bug.
public class TestA {
public TestA()
{
}
public class TestB
{
public Integer doSomething()
{
Integer x = 1;
Integer y = x;
return y;
}
public Integer doSomethingElse()
{
Integer a = 1;
Integer b = a * 2;
return a;
}
}
}
@IsTest
private with sharing class TestATest {
private static testmethod void testMe()
{
// Uncomment the line below to work around the lack of code coverage bug
// TestA testAObj = new TestA();
TestA.TestB testBObj = new TestA.TestB();
System.assertEquals(1, testBObj.doSomething());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment