You need to sign in to do that
Don't have an account?
Jerrod Knapp 11
test class for contentversion object
I am writing a test class for a contentversion trigger. VersionData is a required field and is a base64. How do I represent a base64 in my test class? When I try to put in a value I get an error similar to this: "Illegal assignment from String to Blob"
I will recommend you to start using trailhead to learn about test classes
1) https://trailhead.salesforce.com/modules/apex_testing
Also please check below post
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_test.htm
2) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_example.htm
Pleasse check below post sample test class
1) http://amitsalesforce.blogspot.com/2015/06/best-practice-for-test-classes-sample.html
You write a test class for this the same way that you would any other:
- Set up some data for the Trigger to access (ContentVersion )
- Instantiate the Trigger- ContentVersion record
- Execute a method/methods
- Verify the behaviour with asserts.
Sample test class to start
Let us know if this will help you