Verifies that a string contains some expected value.
Namespace:
MbUnit.FrameworkAssembly: MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)
Syntax
| C# |
|---|
public static void Contains( string actualValue, string expectedSubstring, StringComparison comparisonType, string messageFormat, params Object[] messageArgs ) |
| Visual Basic (Declaration) |
|---|
Public Shared Sub Contains ( _ actualValue As String, _ expectedSubstring As String, _ comparisonType As StringComparison, _ messageFormat As String, _ ParamArray messageArgs As Object() _ ) |
Parameters
- actualValue
- Type: System..::.String
The actual value.
- expectedSubstring
- Type: System..::.String
The expected substring.
- comparisonType
- Type: System..::.StringComparison
One of the StringComparison values that determines how the expected substring is compared to the actual value.
- messageFormat
- Type: System..::.String
The custom assertion message format, or null if none.
- messageArgs
- Type: array<
System..::.Object
>[]()[]
The custom assertion message arguments, or null if none.
Remarks
This assertion will fail if the string is null.
Exceptions
| Exception | Condition |
|---|---|
| Gallio.Framework.Assertions..::.AssertionException | Thrown if the verification failed unless the current AssertionFailureBehavior indicates otherwise. |
| System..::.ArgumentNullException | Thrown if expectedSubstring is null. |
| System..::.ArgumentException | Thrown if comparisonType |
