February 2019
Intermediate to advanced
450 pages
11h 59m
English
We return to the GoMail code of Chapter 10, Fyne – Material-design-based GUI and create a new file, compose_test.go. As the tests are in the same package, we can test internal function definitions rather than relying on exported APIs—this is common with UI code as long as the application is not large enough to warrant separate packages or libraries. We start by adding the test imports; testing is required for go test code and github.com/stretchr/testify/assert provides helpful assertion functionality. We also import the client email library created for our GoMail examples and finally the Fyne test package, fyne.io/fyne/test:
package mainimport ( "testing" "fyne.io/fyne/test" "github.com/PacktPublishing/Hands-On-GUI-Application-Development-in-Go/client" ...
Read now
Unlock full access