Code Monkey home page Code Monkey logo

apexmock's People

Contributors

jeremyross avatar neowit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apexmock's Issues

README examples are missing map type variables

The examples in the readme have maps without type variables. I was hoping Apex could infer, but it doesn't seem to be the case.

An example from the readme what won't compile:

Account acc1 = (Account)Mock.one('Account', 
                    new Map{ 'MyField__c' => 'some-value', 'OtherField__c' => 123}, true); 

This will:

Account acc1 = (Account)Mock.one('Account', 
                    new Map<String, Object> { 'MyField__c' => 'some-value', 'OtherField__c' => 123}, true); 

Test fails when the user who is testing has another language than english

MockUtil.testGetProfile searches for the profile 'System Administrator'. This can be different if the user who is testing has another language selected.

possible solution :

User u = [Select ID, LanguageLocaleKey FROM User WHERE Id =: UserInfo.getUserId() LIMIT 1];
u.LanguageLocaleKey = 'en_US';
update u;

    System.runAs(u) {
        //every org has System Administrator profile so we can reliably test that it exists
        System.assertNotEquals(null, MockUtils.getProfile('System Administrator'), 'System Administrator profile always exists');
    }

The MockDBTests are failing

Loving this framework!

But after installing this new version I got a lot of save errors on the MockDBTest. It seems that there is a query function missing in the MockDB class ?

PersonAccounts

Hi Andrey,

just to let you know, if person accounts are active, the creation of accounts will fail.
In the MockStandard the name field is provided as default. But a personaccount has no name but a lastname that is required.

You can detect person account by the field isPersonAccount of course. Maybe it fits somewhere...

anyhow, many thanks for the wonderful framework

Andries

Move testMethods to dedicated class

This isn't required, but it's good practice.

Especially since salesforce now requires this in classes with newer metadata types.

Affected files:
MockUtils.cls

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.