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

Overall Code Coverage is 0%
I have the following trigger:

Can anyone please help me with this?
trigger HelloWorldTrigger on Book__c (before insert) { Book__c[] books = Trigger.new; MyHelloWorld.applyDiscount(books); }which calls the function in the follwoing class:
public class MyHelloWorld { public static void applyDiscount(Book__c[] books) { for (Book__c b: books) { b.Price__c *= 0.9; } } }but when I am running a test script:
@isTest private class HelloWorldTestClass { static testMethod void validateHelloWorld() { Book__c b = new Book__c(Name='Behind the Cloud', Price__c=100); System.debug('Price before inserting new book: ' + b.Price__c); // Insert book insert b; // Retrieve the new book b = [SELECT Price__c FROM Book__c WHERE Id =:b.Id]; System.debug('Price after trigger fired: ' + b.Price__c); // Test that the trigger correctly updated the price System.assertEquals(90, b.Price__c); } }its giving me a 0% code coverage
Can anyone please help me with this?
https://success.salesforce.com/issues_view?id=a1p30000000eMoyAAE
Code coverage is something that Salesforce seem to have an enormous amount of difficultly keeping stable, so its always worth checking the known issues.
All Answers
https://success.salesforce.com/issues_view?id=a1p30000000eMoyAAE
Code coverage is something that Salesforce seem to have an enormous amount of difficultly keeping stable, so its always worth checking the known issues.
Thanks
Amit Chaudhary
Thanks Bob!!
it is clear. My point was that due to continous enhancement, developer console does not work properly. Sometimes code did not save, it hangs ....lots of other issues
I am still facing the issue. I can see few classes are getting failed and others are running fine still coverage is shown as 0%. Any help will be appreciated. Is there any other reason for this issue?