You need to sign in to do that
Don't have an account?
Query while writing Test class
Hii Right now I am writing test class, I want to know exact use of unit testing ?
Since as I know, It is used to check all syntax & DML operation of the application to avoid bugs or exception.
But I have one case like right now, In account, there is two type of account named Business account & person account.
Every time we prefer Person Account & I already disable Business account while creating new account so it creates Person account by deafult.
But while writing test class I am writing like this...
acc = new Account(Firstname='manoj', Lastname='gahlot', RecordTypeId='PersonAccountRecordTypeID');
So please tell me am I writing correct test for the type Person account ?
writing a test class is to test the flow of your logic.. and at the same time you have to check for in and outs also. like if and else should be checked prior to do your prod. but as you are saying that u disabled the BA permanantly. means you will never get a BA in your org. Then you don't need to test that. but as the best practise its better to check prior assigning the recordtypeid.
Yaa Kiran, But as i mentioned the sample code, Is that correct for creating Person Account ?
& Please let me know how to test if...else condition in test class since it is not in any function.
Hi,
Please use the sample code for test class.
Please let me know if there is any issue.