In the following test method:
static testMethod void testEmailWithAttachments() {
ContentVersion contentVersion = new ContentVersion();
contentVersion.FileType = 'Text';
contentVersion.VersionData = Blob.valueOf('Some Text');
contentVersion.Title = 'Test';
insert contentVersion;
}
I receive:
Field is not writeable: ContentVersion.FileType
Please advise how to avoid Field is not writeable: ContentVersion.FileType
and make the insert in my test method?