5

I'm trying to complete a some test code and am running into the 'Method does not exist or incorrect signature' error.

I have a data factory class that generates some test records for other test classes.

   @isTest
    public class ABCTestDataFactory {
        public static ABC_Store__c createOneStore(String storeName) {
            ABC_Store__c s = new ABC_Store__c();
            s.Name = storeName;
            insert s;

            return s;
        }

            //other similar methods
     }

When referencing the createOneStore() method in this class from my test method I'm receiving the error...what am I doing wrong here?

@isTest
private class TestUpdateStageInformation {

    static testMethod void TestUpdateOneStageProbability() {
        //create the objects required before creating an opportunity
        ABC_Store__c s = ABC_TestDataFactory.createOneStore('The Test Store 1'); //this is where the error is happening
        ABC_Account__c account = ABC_TestDataFactory.createOneAccount('99999999999', 'TestLastName', TRUE, s.ID);

        Test.startTest();
                   //tests
        Test.stopTest();
    }
}

This is all created in a Developer Org. Thanks for any help you can give.

9

Your declaration in the first block is ABCTestDataFactory, whereas when you're using it , it's ABC_TestDataFactory (with an underscore)

Unless its a typo in your post, that would be the reason?

  • Ahhh thank you! Been staring at it too long and sometimes, I just need a sanity check. Silly mistake... – Scott McClung Sep 29 '12 at 17:35
  • We can all do with an extra pair of eyes at times :) – techtrekker Sep 29 '12 at 17:36
  • very good catch. – Forceguru Sep 29 '12 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.