GithubHelp home page GithubHelp logo

generateapextesttemplate-toolingapi's Introduction

GenerateApexTestTemplate-ToolingApi

Generates the Apex Class template to create the test classes for all the apex classes where there isn't any test class specified. The test class is recognised by 'Test_' prefix.

Features:

a) Creates the test class for each of the apex classes where there isn't any test class specified. For e.g. suppose there are two apex classes in our org - 'ApexClass1' and 'ApexClass2' and there is a test class for 'ApexClass2' which is called - 'Test_ApexClass2'. When we execute the call (i.e. GenerateTemplate.generateTestClassTemplate();), it checks for existing test classes and creates one if there isn't any. In this case, it would create 'Test_ApexClass1' for 'ApexClass1'.

b) Add the comments and the class body with two methods - runPositiveTestCases() and runNegativeTestCases(). This may help an org to have proper naming conventions throughout all of the test classes by using a particular template.

Directions to Use:

To create the templates for all the test classes, please use the following :- GenerateTemplate.generateTestClassTemplate();

You could call the above method directly from your developer console (as this is a one time process) or from anywhere else wherever you feel like.

Also, please make sure that the remote site settings are properly set to:

https://(instance_name).salesforce.com

or

https://c.(instance_name).visual.force.com (if calling form visualforce page)

Feedback

It would be great if you could provide a feedback on this. Its just a starting point so looking forward to hearing from you and improve the functionality.

Please also note that this repo is heavily pulled up from https://github.com/afawcett/apex-toolingapi Thanks to Andrew for his continued help.

generateapextesttemplate-toolingapi's People

Contributors

tquilapratyush avatar

Watchers

 avatar  avatar  avatar

Forkers

rkakumanu0317

generateapextesttemplate-toolingapi's Issues

Poor naming convention

Naming a test Class test_CLASSNAME is not a best practice. The best practice taught in the Dev501 course is CLASSNAME_test. That way all the classes appear next to eachother.

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.