I'm attempting to create a test class for the following code
global class AttachmentCreate {
webService static String AttachPDFToQuote(string Id) {
string result = '';
PageReference pageRef = new PageReference('/apex/SOMEQUOTETEMP?Id='+Id);
Blob content = pageRef.getContent();
QuoteDocument qdoc = new QuoteDocument(Document = content, QuoteId = Id);
insert qdoc;
result='SUCCESS';
return result;
}
}
Here is my test class code:
@isTest
global class AttachmentCreateTest {
static testMethod void AttachPDFToQuoteTTest() {
string result = '';
string Id = '0Q041000000Xafi';
test.starttest();
PageReference pageRef = new PageReference('/apex/SOMEQUOTETEMP?Id='+Id);
Blob content = Blob.valueOf('UNIT.TEST');
QuoteDocument doc = new QuoteDocument(Document = content, QuoteId = Id);
insert doc;
result='SUCCESS';
test.stoptest();
}
}
The problem is, when I validate the code in the inbound change sets, I get the error that my class has zero code coverage. Why is that?