The goal of this homework is to write tests in students_test.go
file and achieve as much coverage as possible.
Inside this repo you can find 2 files and one directory:
- File
toBeTested.go
contains functions which should be tested. Do not change this file. - File
students_test.go
is a boilerplate of file with your tests. At the start of this file you can findinit()
function, which is required because of peculiarities of Autocode platform. This function will copy your file to/autocode
folder, do not touch this function. - Folder
/autocode
to which your test will be automatically copied when you locally trigger your tests.
Workflow to pass a homework:
- Write tests in
students_test.go
- Run your tests locally to check it status and resulted coverage. Each time you run tests your code will be copied to
/autocode
folder. The name of copied file (without an extension) isstudents_test
- it's correct. Please, do not modify this file manually, do it every time by triggeringgo test
. - Repeat steps 1 and 2 before you get desired result.
- When you will be ready to submit and test you solution on Autocode, you will need to commit and push
autocode/students_test
file to git. Make sure that this file was automatically updated.
After submitting of your solution on Autocode you will get some logs. Keep in mind that you will only get the result of your tests if they fail. Otherwise, you will only get the coverage value. If you faced with some error or did not achieve desired coverage - modify your code and try again.