Loggers consist of some stdout plus a file for logging. There’s usually just a log handler object that contains those things, and a couple more attributes like filename, path, and project name. There’s nothing happening there but writing output and creating log handlers.

of these usually involves using the same fakes, with the same assertions over and over again (just change the text), albeit with some potentially complicated setup, and to test methods that deal with project names, we’d have to somehow either fake a debug stack, as is the case with this code:

//GetProjectNames Gets the projects to use for the log handler instance. Usually used for the debug stack.
func (handler *LogHandlerSt) GetProjectNames() []string {
    var projectNames = []string{handler.projectName}
    projectNames = append(projectNames, includeStack...)
    return projectNames

or hit a bunch of methods, preferably one with a callback func containing the invocation and test expectations.

Is this my effort?

Source link https://sqa.stackexchange.com/questions/35219/are---worth-testing


Please enter your comment!
Please enter your name here