Package helloworld.structural.composite

Source Code of helloworld.structural.composite.CompositeHelloWorldTest

package helloworld.structural.composite;

import helloworld.HelloWorld;
import helloworld.structural.bridge.DesignPatternWorldImpl;
import helloworld.structural.bridge.HelloWorldBridge;
import helloworld.structural.bridge.JavaHelloWorldImpl;
import org.junit.Test;

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

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

    @Test
    public void testCompositeHelloWorld(){
        HelloWorld emptyCompositeHelloWorld = new CompositeHelloWorld();
        assertThat(emptyCompositeHelloWorld.helloWorld(),isEmptyString());
        HelloWorld compositeHelloWorld = new CompositeHelloWorld(new CompositeHelloWorld.DefaultHelloWorld());
        assertThat(compositeHelloWorld.helloWorld(),is("Hello Composite!"));
    }
}
TOP

Related Classes of helloworld.structural.composite.CompositeHelloWorldTest

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.