Package helloworld.structural.bridge

Source Code of helloworld.structural.bridge.HelloWorldBridgeTest

package helloworld.structural.bridge;

import helloworld.HelloWorld;
import helloworld.structural.adapter.HelloAdapterDesignPattern;
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

/**
* @author yihua.huang@dianping.com
*/
public class HelloWorldBridgeTest {

    @Test
    public void testHelloWorldAdapter(){
        HelloWorld bridgeHelloWorld = new HelloWorldBridge(new JavaHelloWorldImpl());
        assertThat(bridgeHelloWorld.helloWorld(),is("Hello Java!"));
        bridgeHelloWorld = new HelloWorldBridge(new DesignPatternWorldImpl());
        assertThat(bridgeHelloWorld.helloWorld(),is("Hello Bridge!"));
    }
}
TOP

Related Classes of helloworld.structural.bridge.HelloWorldBridgeTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.