# Testing
I have written tests covering all of the Universe programming done for Sherwin Williams EDI. These tests should be ran before and after making changes to any of the code. This will ensure that everything is working properly and that there were no unintentional errors caused by changes.
Note
If making changes to any of the code, make sure you either update the tests so they are passing or create a new test so that your new code is being covered.
TIP
When adding a new feature or fixing a bug, it might be best to write the test first and make sure it is not passing. Then make any code changes so that the test passes. This is called Test Driven Development (TDD).
# Running the tests
There are 4 different test files. Here is how to run each one. These commands should be typed into the TCL prompt.
MV.TEST NRL.BP TEST.SW.EDI.TOKENS
MV.TEST NRL.BP TEST.SW.EDI.ORDERS
MV.TEST NRL.BP TEST.SW.EDI.ACK
MV.TEST NRL.BP TEST.SW.EDI.INVOICES
# Testing the Real API
In the orders, acknowledment and invoices tests, most of the tests are only mocking the Infocon API call. This means they are not actually calling the real API every time you run the tests. There are some tests that do hit the real API if you are wanting to test the real thing. These have the word "REAL" somewhere in the test name. These should always be set to SKIP unless that is really what you are wanting to test.
TIP
If you are testing the real API, you'll probably also want to change the SKIP to ONLY.