设计模式 adapter_test 实现
golang 设计模式 adapter_test 代码实现
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)
}
}
目录
相关文章
0
赞