All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.magentys.FunctionalVerifier Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package io.magentys;

import io.magentys.functional.Functions;
import org.hamcrest.Matcher;

import static org.junit.Assert.assertThat;

/**
 * Created by kostasmamalis on 29/04/16.
 */
public class FunctionalVerifier extends AgentVerifier {

    public FunctionalVerifier(FunctionalAgent agent) {
        super(agent);
    }

    public static FunctionalVerifier verifyAsFunctional(FunctionalAgent agent) {
        return new FunctionalVerifier(agent);
    }

    public  void that(Functions.FunctionalMission obj, Matcher objectMatcher) {
        assertThat(obj.apply((FunctionalAgent) agent), objectMatcher);
    }

    public  void that(Functions.FunctionalMission1 func, Input1 input, Matcher objectMatcher) {
        FunctionalAgent functionalAgent = (FunctionalAgent) agent;
        assertThat(functionalAgent.performs(func,input), objectMatcher);
    }

    public  void that(Functions.FunctionalMission2 func, Input1 input, Input2 input2, Matcher objectMatcher) {
        FunctionalAgent functionalAgent = (FunctionalAgent) agent;
        assertThat(functionalAgent.performs(func,input, input2), objectMatcher);
    }

    public  void that(Functions.FunctionalMission3 func, Input1 input, Input2 input2, Input3 input3, Matcher objectMatcher) {
        FunctionalAgent functionalAgent = (FunctionalAgent) agent;
        assertThat(functionalAgent.performs(func,input, input2, input3), objectMatcher);
    }

    public  void that(Functions.FunctionalMission4 func, Input1 input, Input2 input2, Input3 input3, Input4 input4, Matcher objectMatcher) {
        FunctionalAgent functionalAgent = (FunctionalAgent) agent;
        assertThat(functionalAgent.performs(func,input, input2, input3,input4), objectMatcher);
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy