@TestInterface(value=ch.powerunit.pattern.impl.PatternTesterImpl.class) public final class PatternTester extends Object
Pattern.
This tester will validate that a Pattern accept (
Pattern.matcher(CharSequence)) or not a specified string ; In the
first case (accepted), it also provide a way to validate the groups (
Matcher.group(int)).
| Modifier and Type | Method and Description |
|---|---|
List<List<Matcher<String>>> |
getExpectedGroup()
Used by the framework.
|
List<Boolean> |
getExpectedResult()
Used by the framework.
|
List<List<Integer>> |
getHavingGroup()
Used by the framework.
|
List<String> |
getInputs()
Used by the framework.
|
Pattern |
getUnderTest()
Used by the framework.
|
static PatternTester0 |
of(Pattern pattern)
Start the DSL to create a tester of Pattern, based on a String.
|
static PatternTester0 |
of(String pattern)
Start the DSL to create a tester of Pattern, based on a String.
|
public static PatternTester0 of(String pattern)
The passed String will be compiled as a Pattern.
For instance :
@TestDelegate
public final PatternTester sample1 = PatternTester.of("a+").receiving("b")
.thenNoMatching().receiving("aa").thenMatching().build();
pattern - the pattern, as a StringThe next step of the
DSL.of(Pattern)public static PatternTester0 of(Pattern pattern)
For instance :
@TestDelegate
public final PatternTester sample1 = PatternTester.of(Pattern.compile("a+"))
.receiving("b").thenNoMatching().receiving("aa").thenMatching().build();
pattern - the pattern.The next step of the
DSL.public Pattern getUnderTest()
public List<Boolean> getExpectedResult()
public List<List<Integer>> getHavingGroup()
public List<List<Matcher<String>>> getExpectedGroup()
Copyright © 2018 Powerunit. All rights reserved.