go-pattern-examples/structure/02_adapter/adapter_test.go
2020-04-21 22:53:23 +08:00

15 lines
255 B
Go

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)
}
}