Skip to content

Instantly share code, notes, and snippets.

@afawcett
Created May 5, 2013 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afawcett/5521019 to your computer and use it in GitHub Desktop.
Save afawcett/5521019 to your computer and use it in GitHub Desktop.
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