Created
May 5, 2013 14:47
-
-
Save afawcett/5521019 to your computer and use it in GitHub Desktop.
Reproduction of Salesforce code coverage bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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