Package net.emaze.dysfunctional.dispatching.adapting

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

package net.emaze.dysfunctional.dispatching.adapting;

import net.emaze.dysfunctional.dispatching.delegates.ConstantProvider;
import net.emaze.dysfunctional.dispatching.logic.Proposition;
import org.junit.Assert;
import org.junit.Test;

public class ProviderToPropositionTest {

    @Test(expected = IllegalArgumentException.class)
    public void creatingWithNullProviderYieldsException() {
        new ProviderToProposition(null);
    }

    @Test
    public void callingThePropositionYieldsProviderResult() {
        final Boolean expected = Boolean.TRUE;
        final Proposition proposition = new ProviderToProposition(new ConstantProvider<Boolean>(expected));
        Assert.assertEquals(expected, proposition.state());
    }
}
TOP

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

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.