My test class for inserting contact is
static testmethod void invoicetest(){
string strrecord = [select id from RecordType where SobjectType='Account' AND IsPersonType=True limit 1].id;
system.debug('strrrrr'+strrecord);
Account acc = new Account(firstName='test',LastName='Acc',Recordtypeid=strrecord);
insert acc;
contact con = new contact(firstname='Test',LastName='Contact',Salutation='Mr',Accountid=acc.id);
insert con;
Then I'm getting error as System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Can not select a person account: [AccountId]
How to come out of this!!!!!!!!!
My Apex Class is
conlist = new contact[0];
con.lastname = billing.billinglastname;
con.firstname = billing.billinglastname;
conlist.add(con);
if(con.lastname != null){
insert conlist; //getting error here
}