mirror of
https://github.com/crazybber/go-pattern-examples.git
synced 2024-11-23 12:26:03 +03:00
15 lines
255 B
Go
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)
|
||
|
}
|
||
|
}
|