Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2008 Ovea <dev@testatoo.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.testatoo.core.matcher;
This class is a matcher (written based on hamcrest possibilites) to test the text of the button.

Author(s):
dev@testatoo.org
public final class Text extends TypeSafeMatcher<Button> {
    private String text;

    
Uses the matcher SelectedValue to compare the text on a button to the expected text of the matcher, using the syntax "text("xxx")"

Parameters:
button the button
Returns:
True if the text on the button is equal to the text of the matcher Text
    @Override
    public boolean matchesSafely(Button button) {
        return button.text().equals();
    }

    
To append the description of the text on the button to the given description

Parameters:
description the description may be part of a a description of a larger object
    public void describeTo(Description description) {
        description.appendText("text:" + );
    }

    
Constructor with given value

Parameters:
text text we want to know if it's the text on the button
    public Text(String text) {
        this. = text;
    }


    
Using the syntax "text("xxx")", the test creates a Text matcher

Parameters:
text the text to compare to the text on the button
Returns:
a new Text matcher
    @Factory
    public static Matcher<Buttontext(String text) {
        return new Text(text);
    }
New to GrepCode? Check out our FAQ X