Is there a solution that passes the trailhead test?

Is there a solution that passes the trailhead test?

Hi Amit, thanks for writing a solution! It is true that Amit’s solution passes the Trailhead test, in this case because running his test gives 100% code coverage. However, his test code itself is not actually a test written in the sense of a unit test (please take this as constructive, Amit!).

Is the trailhead 100% code coverage challenge broken?

But the challenge says “Challenge not yet complete… here’s what’s wrong: The ‘RestrictContactByName’ class did not achieve 100% code coverage via your test methods”. The challenge is broken in my view.

Is the trailhead challenge broken in my view?

The challenge is broken in my view. Same issue with me and a few others who are also taking this trailhead; our solution was to run the tests from the UI instead of the console, and for whatever reason that satisfied the code coverage demons. Got the same error, tried many ways, many things.

How to create unit tests in Salesforce trailhead?

Apex Unit Tests 1 Code Coverage Requirement for Deployment. 2 Test Method Syntax. 3 Unit Test Example: Test the TemperatureConverter Class. 4 Increase Your Code Coverage. 5 Create and Execute a Test Suite. 6 Creating Test Data. 7 Tell Me More…

How to check code coverage in trailhead challenge?

With Above test class i got all 500 Point. After Click on Run Test Check code coverage on Trigger. Then only Submit the exam. Please mark this as solution if this will help you. So that if some one have same issue this post can help It doesn’t work. I thought it was because I didn’t considered the “before update” of the trigger.

Why is challangecomplete not successful in unit of work?

The ‘challangeComplete’ method in the ‘UnitOfWorkTest’ class has not successfully passed all tests. Ensure that you run the tests and it passes successfully before attempting this challenge again. However, when I run my code in Developer Console, my test passes.

How to create unit of work test in apex?

Check out Trailhead Playground Management. The test class must be named UnitOfWorkTest with a test method named challengeComplete. Call the commitWork method to update the database. Run the test at least once before attempting the challenge. It must pass successfully with the following assertions: