Freigeben über


MoreAsserts.AssertContainsRegex Method

Definition

Overloads

AssertContainsRegex(String, String)

Variant of #assertContainsRegex(String,String,String) using a generic message.

AssertContainsRegex(String, String, String)

Asserts that expectedRegex matches any substring of actual and fails with message if it does not.

AssertContainsRegex(String, String)

Variant of #assertContainsRegex(String,String,String) using a generic message.

[Android.Runtime.Register("assertContainsRegex", "(Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")]
public static Java.Util.Regex.IMatchResult? AssertContainsRegex (string? expectedRegex, string? actual);
[<Android.Runtime.Register("assertContainsRegex", "(Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")>]
static member AssertContainsRegex : string * string -> Java.Util.Regex.IMatchResult

Parameters

expectedRegex
String
actual
String

Returns

Attributes

Remarks

Variant of #assertContainsRegex(String,String,String) using a generic message.

Java documentation for android.test.MoreAsserts.assertContainsRegex(java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AssertContainsRegex(String, String, String)

Asserts that expectedRegex matches any substring of actual and fails with message if it does not.

[Android.Runtime.Register("assertContainsRegex", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")]
public static Java.Util.Regex.IMatchResult? AssertContainsRegex (string? message, string? expectedRegex, string? actual);
[<Android.Runtime.Register("assertContainsRegex", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")>]
static member AssertContainsRegex : string * string * string -> Java.Util.Regex.IMatchResult

Parameters

message
String
expectedRegex
String
actual
String

Returns

Attributes

Remarks

Asserts that expectedRegex matches any substring of actual and fails with message if it does not. The Matcher is returned in case the test needs access to any captured groups. Note that you can also use this for a literal string, by wrapping your expected string in Pattern#quote.

Java documentation for android.test.MoreAsserts.assertContainsRegex(java.lang.String, java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to