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

class test error
Hi,
I get an error " testcode: Type is not visible: test " when I deploys my sand box to the production.
"testcode" is the name of my test class.
I renamed my class test with "test" but I got an error at this level "Test.startTest();" in thecode of my test class. this error is " Methode does not exist or incorrect signature: Test.startTest()".
please help me.
thanks.
moh.
You can delete the test class in Production and then push a fresh copy with the name changed to the production org.
All Answers
can you post the test code ??
this is my test class:
/******************************************************/
@isTest
private class testcode {
/***************************************************************************************************************************/
public static testmethod void t1()
{
//trigger comFraisCatalogue
commission_et_frais_par_catalogue__c comFraisCat = new commission_et_frais_par_catalogue__c
(Code_catalogue__c='test');
insert comFraisCat;
}
/****************************************************************************************************************************/
//test unitaire du trigger calculTaxeProdOpp
public static testmethod void t2()
{
String OppoId;
String pricebookId;
OpportunityLineItem OppLineItem = [select OpportunityId, Quantity from OpportunityLineItem limit 1];
OppLineItem.Quantity = 4;
Opportunity opp = [select id from Opportunity limit 1];
OppoId =opp.id;
PricebookEntry pricebook = [Select Id From PricebookEntry limit 1];
pricebookId=pricebook.id;
try{
update OppLineItem; // hit the trigger
OpportunityLineItem oppItem = new OpportunityLineItem
(UnitPrice=1, Taxe__c=1, Quantity=1, OpportunityId=OppoId );
}catch(DMLException e){
system.assert(true,'Caught DML Exception Updating Opportunity:'+e.getDMLMessage(0));
}
}
//test batch
public static testmethod void t62()
{
Test.startTest();
BalanceCalculBatch ch = new BalanceCalculBatch();
ID batchprocessid = Database.executeBatch(ch);
Test.stopTest();
}
}
/*****************************************************/
another precision:
my class test is named in my production "test" but in my sandbox "testcode".
how to rename the test class in my production, because I can not name it in the sandbox because of test method.
Thanks.
You can delete the test class in Production and then push a fresh copy with the name changed to the production org.