Giter Site home page Giter Site logo

brunagirao / apex-test-data-factory Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benahm/testdatafactory

0.0 0.0 0.0 1.3 MB

The ultimate Apex Test Data Factory ๐Ÿญ

Home Page: https://github.com/benahm/TestDataFactory

License: Apache License 2.0

Apex 100.00%

apex-test-data-factory's Introduction

Apex Test Data Factory

โ€œ The ultimate Apex Test Data Factory โ€ ๐Ÿญ ๐Ÿ‘Œ

Generate & insert an sObject with all the required fields & relationships auto-filled

Contact con = (Contact)TestDataFactory.createSObject('Contact');

Inserted data*:

Contact:{Id='0036E00000R4nG0QAJ', Lastname:'test0'}

Assign values to fields of the main sObject and the related sObjects

Contact con = (Contact)TestDataFactory.createSObject('Contact', new Map<String,Object>{
  'Email' => '[email protected]',
  'Account.Description' => 'Text for the Description field on the Account'
});

Inserted data*:

Contact:{Id='0036E00000R55chQAB', Lastname:'test0', Email:'[email protected]', AccountId='0016E00000Z6bC7QAJ'}
Account:{Id='0016E00000Z6bC7QAJ', Name='test0', Description='Text for the Description field on the Account'}

* in a non-customized org

Install :

Get the TestDataFactory class by installing the TestDataFactory Unlocked Package ๐Ÿ”“๐Ÿ“ฆ in your org using the UI or by running the following sfdx command

sfdx force:package:install --wait 10 --publishwait 10 --package 04t1n000002WsK5AAK -r -u AliasOfYourOrg

More :

Apache 2.0

apex-test-data-factory's People

Contributors

benahm avatar dosmakov avatar renatoliveira avatar

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.