Package net.emaze.dysfunctional.dispatching.delegates

Source Code of net.emaze.dysfunctional.dispatching.delegates.FlipperTest

package net.emaze.dysfunctional.dispatching.delegates;

import net.emaze.dysfunctional.dispatching.adapting.ConcatenateString;
import org.junit.Assert;
import org.junit.Test;

/**
*
* @author rferranti
*/
public class FlipperTest {

    @Test(expected = IllegalArgumentException.class)
    public void creatingFlipperWithNullDelegateYieldsException() {
        new Flipper<String, String, String>(null);
    }

    @Test
    public void decoratingWithFlipperFlipsParams() {
        final ConcatenateString concat = new ConcatenateString();
        final BinaryDelegate<String, String, String> flipped = new Flipper<String, String, String>(concat);
        Assert.assertEquals("latterformer", flipped.perform("former", "latter"));
    }
}
TOP

Related Classes of net.emaze.dysfunctional.dispatching.delegates.FlipperTest

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.