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

ch.powerunit.matchers.lang.MatcherAssertion Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
/**
 * Powerunit - A JDK1.8 test framework
 * Copyright (C) 2014 Mathieu Boretti.
 *
 * This file is part of Powerunit
 *
 * Powerunit is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Powerunit is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Powerunit. If not, see .
 */
package ch.powerunit.matchers.lang;

import org.hamcrest.Matcher;

/**
 * Use to define the expectation on one single instance of a matcher.
 * 
 * @author borettim
 * @since 0.3.0
 */
public interface MatcherAssertion> {
	/**
	 * Indicate that this matcher instance must accept the null value.
	 * 
	 * @return continuation of the DSL.
	 */
	MatcherAssertion nullAccepted();

	/**
	 * Indicate that this matcher instance must reject the null value with a
	 * message accepted by a matcher.
	 * 
	 * @param rejectedMessage
	 *            the matcher on the message
	 * @return continuation of the DSL
	 */
	MatcherAssertion nullRejected(Matcher rejectedMessage);

	/**
	 * Indicate that this matcher instance must reject the null value with a
	 * message.
	 * 
	 * @param rejectedMessage
	 *            the expected message
	 * @return continuation of the DSL
	 */
	MatcherAssertion nullRejected(String rejectedMessage);

	/**
	 * Define a list of value accepted by this matcher.
	 * 
	 * @param values
	 *            the values accepted by this matcher
	 * @return continuation of the DSL
	 */
	MatcherAssertion accepting(Object... values);

	/**
	 * Define a list of value rejected by this matcher.
	 * 
	 * @param reject
	 *            the values (and expectation on rejecting message) rejected by
	 *            this this matcher.
	 * @return continuation of the DSL
	 * @see ch.powerunit.matchers.MatcherTester#value(Object)
	 */
	MatcherAssertion rejecting(Reject... reject);

	/**
	 * Definition of a rejected value.
	 * 
	 * @author borettim
	 * @since 0.3.0
	 */
	interface Reject {

	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy