Git Product home page Git Product logo

unit-tests's Introduction

Coding 101 - Unit Testing

Setup

Fork this repository

Create a new branch - name it whatever you like, but note it down!

Clone to your local machine

On your local machine, cd into the directory created for your clone and switch to your new branch using the command:

git checkout <branchname>

Challenge

  1. Build out the ./force-app/main/default/OpportunityUtils_Test.cls class to cover all scenarios you can identify. Note that 100% test coverage does not indicate all scenarios are covered! Check all of your unit tests pass before submitting your solution.

Notes

The following Trailhead modules are available to learn more about unit testing in Apex:

Implementing

Carry out all work in your local filesystem using VS Code, as you will need to send them back to Github.

  1. Create a scratch org (or connect to an existing one)
  2. Push the code to your scratch org - this will check that your code compiles
  3. Execute the tests - this will check that your tests are doing what you think they are

Submitting Your Solution for Assessment

Please note that assessment is only available to BrightGen employees or by prior arrangement with Keir Bowden (aka Bob Buzzard). If you don't satisfy this criteria your pull request will not be reviewed.

Add keirbowden as a collaborator to your new repository

The commands below are if you are using Git from the command line - you can also use the VS Code built-in source control functionality.

Stage your updated class using the following command:

git add force-app/main/default/classes

and then commit the changes :

git commit

and push these to the remote repository

git push origin <branchname>

Once you are happy with your solution, open a pull request

Then wait!

unit-tests's People

Contributors

keirbowden 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.