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

net.thucydides.core.hamcrest.ContainsInOrderMatcher Maven / Gradle / Ivy

There is a newer version: 0.9.275
Show newest version
package net.thucydides.core.hamcrest;

import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;

import java.util.Arrays;
import java.util.List;

/**
 * Check that a list of strings contains specific strings in a specific order.
 */
public class ContainsInOrderMatcher extends TypeSafeMatcher> {

    private List values;

    public ContainsInOrderMatcher(final String... values) {
        this.values = Arrays.asList(values);
    }

    public boolean matchesSafely(final List orderedListOfValues) {
        return values.equals(orderedListOfValues);
    }


    public void describeTo(final Description description) {
        description.appendText("an ordered list containing ").appendText(values.toString());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy