You need to sign in to do that
Don't have an account?

Unit test for QuoteDocument
How do I write a unit test for
QuoteDocument qd = new QuoteDocument(); qd = [SELECT CreatedById, CreatedDate, IsDeleted, Discount, GrandTotal, LastModifiedById, LastModifiedDate, Name, Document, QuoteId, Id, SystemModstamp FROM QuoteDocument WHERE QuoteId =: urlId Limit 1]; blst.add(EncodingUtil.base64Encode(qd.Document)); System.debug('the size of the file' + qd.Document.size()); String formatJSON = JSON.serializePretty(blst); record = new Document( FolderId = UserInfo.getUserId() ,AuthorId=UserInfo.getUserId(), Name = Name +'_' + datetime.now() +'.pdf', Body = b ,ContentType='application/pdf;charset=UTF-8'); System.debug('Record' + record); insert record;
Please check the below post and it will solve your issue:
https://developer.salesforce.com/forums/?id=906F000000093ZEIAY
Regards,
Mahesh