100% Guaranteed Results


Testing go – # Exercise 1 Solved
$ 29.99
Category:

Description

5/5 – (1 vote)

In this exercise, you will implement and execute basic test cases with the help of the standard `testing` package. Later, you will use the external package Testify to simlify the assertion definitions. Use the IDE or editor of your choice.

1. Navigate to the directory `start`. You will find an existing Go project.
2. Inspect both Go files `main.go` and `hello.go`.
3. Create a new test Go file for the logic in `hello.go`.
4. Implement all test cases to cover as much of the code as possible with the standard `testing` package. Follow best practices as much as possible when defining variables and assertion messages.
5. Execute the test cases from the command line. Make test cases fail first to ensure that the expectations are set up correctly.
6. (Optional) Discuss: What are the issues with the current implementation? How would you improve on the current implementation?
7. Add the external package `github.com/stretchr/testify` to the module definition. 8. Use the Testify API to simplify the assertions.

Reviews

There are no reviews yet.

Be the first to review “Testing go – # Exercise 1 Solved”

Your email address will not be published. Required fields are marked *

Related products