001/**
002 * Powerunit - A JDK1.8 test framework
003 * Copyright (C) 2014 Mathieu Boretti.
004 *
005 * This file is part of Powerunit
006 *
007 * Powerunit is free software: you can redistribute it and/or modify
008 * it under the terms of the GNU General Public License as published by
009 * the Free Software Foundation, either version 3 of the License, or
010 * (at your option) any later version.
011 *
012 * Powerunit is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015 * GNU General Public License for more details.
016 *
017 * You should have received a copy of the GNU General Public License
018 * along with Powerunit. If not, see <http://www.gnu.org/licenses/>.
019 */
020package ch.powerunit.function.lang;
021
022import java.util.function.Supplier;
023
024import org.hamcrest.Matcher;
025
026/**
027 * Specify the expected result.
028 * 
029 * @author borettim
030 * @since 0.3.0
031 */
032public interface FunctionTesterDefineDSL<T, R> {
033        /**
034         * Specify the expected result.
035         * 
036         * @param result
037         *            the expected value.
038         * @return the {@link FunctionTesterNextDSL next step of the DSL}
039         */
040        FunctionTesterNextDSL<T, R> thenExpectingResult(R result);
041
042        /**
043         * Specify the expected result.
044         * 
045         * @param result
046         *            a supplier for the expected value
047         * @return the {@link FunctionTesterNextDSL next step of the DSL}
048         */
049        FunctionTesterNextDSL<T, R> thenExpectingResult(Supplier<R> result);
050
051        /**
052         * Specify the expected result. Specify the expected result.
053         * 
054         * @param matching
055         *            a matcher on the expected value.
056         * @return the {@link FunctionTesterNextDSL next step of the DSL}
057         */
058        FunctionTesterNextDSL<T, R> thenExpectingResultThat(
059                        Matcher<? super R> matching);
060
061        /**
062         * Specify the expected result.
063         * 
064         * @param matching
065         *            a supplier for the matcher on the expected value
066         * @return the {@link FunctionTesterNextDSL next step of the DSL}
067         */
068        FunctionTesterNextDSL<T, R> thenExpectingResultThat(
069                        Supplier<Matcher<? super R>> matching);
070}