mirror of
https://github.com/retailcrm/api-client-go.git
synced 2024-11-25 06:16:03 +03:00
Neur0toxine
97b1abf470
* refactor library and upgrade version * remove useless environment variable * remove unsupported versions from go.mod * fixes for error handling & data types * different improvements for errors * fixes for types and tests * better coverage, fix error with the unmarshalers
25 lines
462 B
Go
25 lines
462 B
Go
package retailcrm
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
type wrappedLogger struct {
|
|
lastMessage string
|
|
}
|
|
|
|
func (w *wrappedLogger) Debugf(msg string, v ...interface{}) {
|
|
w.lastMessage = fmt.Sprintf(msg, v...)
|
|
}
|
|
|
|
func TestDebugLoggerAdapter_Printf(t *testing.T) {
|
|
wrapped := &wrappedLogger{}
|
|
logger := DebugLoggerAdapter(wrapped)
|
|
logger.Printf("Test message #%d", 1)
|
|
|
|
assert.Equal(t, "Test message #1", wrapped.lastMessage)
|
|
}
|