go-pattern-examples/structure/02_adapter/adapter_test.go

15 lines
255 B
Go
Raw Normal View History

2020-04-21 17:50:21 +03:00
package adapter
import "testing"
var expect = "adaptee method"
func TestAdapter(t *testing.T) {
adaptee := NewAdaptee()
target := NewAdapter(adaptee)
res := target.Request()
if res != expect {
t.Fatalf("expect: %s, actual: %s", expect, res)
}
}