Package net.emaze.dysfunctional.dispatching.adapting

Source Code of net.emaze.dysfunctional.dispatching.adapting.PropositionToProviderTest

package net.emaze.dysfunctional.dispatching.adapting;

import net.emaze.dysfunctional.dispatching.delegates.Provider;
import net.emaze.dysfunctional.dispatching.logic.Yes;
import org.junit.Assert;
import org.junit.Test;

public class PropositionToProviderTest {
    @Test(expected = IllegalArgumentException.class)
    public void creatingWithNullPropositionYieldsException() {
        new PropositionToProvider(null);
    }

    @Test
    public void callingThePropositionYieldsProviderResult() {
        final Boolean expected = Boolean.TRUE;
        final Provider<Boolean> provider = new PropositionToProvider(new Yes());
        Assert.assertEquals(expected, provider.provide());
    }
}
TOP

Related Classes of net.emaze.dysfunctional.dispatching.adapting.PropositionToProviderTest

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.