|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| EndsWithConstraint.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 | package com.agical.rmock.core.match.constraint; | |
| 2 | ||
| 3 | import com.agical.rmock.core.match.Constraint; | |
| 4 | ||
| 5 | /** | |
| 6 | * @author brolund | |
| 7 | * | |
| 8 | * (c) 2005 Agical AB | |
| 9 | */ | |
| 10 | public class EndsWithConstraint extends AbstractConstraint implements | |
| 11 | Constraint { | |
| 12 | ||
| 13 | 2 | public EndsWithConstraint(Object reference) { |
| 14 | 2 | super("endsWith", reference); |
| 15 | } | |
| 16 | ||
| 17 | 4 | public boolean passes(Object object) { |
| 18 | 4 | return ((String)object).endsWith( (String)getReference().getObject() ); |
| 19 | } | |
| 20 | ||
| 21 | } |
|
||||||||||