+ Start a Discussion
Sonam PatilSonam Patil 

Assertion failed error

Here is my testClass code.
I am getting error as Assertion failed.
Please Can anyone help me to solve this'

@isTest public class BookTest {
public static @isTest void btest(){
Book__c b = new Book__c(Name='Kcloud', price__c=100);
System.debug('The price of a book before insert is:'+b.Price__c);
 insert b;
b=[Select id,Name,price__c from Book__c where id=:b.id];
System.debug('The price of the book after thr trigger is fired:'+b.Price__c); System.assertEquals(90,b.price__c);
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Sonam,
Is the trigger deducting the price? If not, it shold be 100, instead of 90.

Sumit Kumar Singh.