|
3342 | 3342 | "articles/nunit/writing-tests/constraints/EndsWithConstraint.html": { |
3343 | 3343 | "href": "articles/nunit/writing-tests/constraints/EndsWithConstraint.html", |
3344 | 3344 | "title": "EndsWith Constraint | NUnit Docs", |
3345 | | - "summary": "EndsWith Constraint EndsWithConstraint tests for an ending string. Constructor EndsWithConstraint(string expected) Syntax Does.EndWith(string expected) EndsWith(string expected) Modifiers ...IgnoreCase Examples of Use string phrase = \"Make your tests fail before passing!\"; Assert.That(phrase, Does.EndWith(\"!\")); Assert.That(phrase, Does.EndWith(\"PASSING!\").IgnoreCase); Notes EndsWith may appear only in the body of a constraint expression or when the inherited syntax is used." |
| 3345 | + "summary": "EndsWith Constraint EndsWithConstraint tests for an ending string. Constructor EndsWithConstraint(string expected) Syntax Does.EndWith(string expected) EndsWith(string expected) Modifiers ...IgnoreCase ...Using(StringComparison comparisonType) ...Using(CultureInfo culture) Examples of Use string phrase = \"Make your tests fail before passing!\"; Assert.That(phrase, Does.EndWith(\"!\")); Assert.That(phrase, Does.EndWith(\"PASSING!\").IgnoreCase); Specifying a StringComparison Assert.That(\"Hello World!\", Does.EndWith(\"WORLD!\").Using(StringComparison.OrdinalIgnoreCase)); Assert.That(\"Hello World!\", Does.EndWith(\"World!\").Using(StringComparison.Ordinal)); Specifying a CultureInfo The Using(CultureInfo) modifier allows for culture-specific string comparisons. It can be combined with .IgnoreCase for case-insensitive culture-aware comparisons: // Using Turkish culture where 'i' and 'I' have special casing rules Assert.That(\"text TITLE\", Does.EndWith(\"title\").IgnoreCase.Using(new CultureInfo(\"tr-TR\"))); // Culture-specific comparison without case-insensitivity Assert.That(\"Main Straße\", Does.EndWith(\"Straße\").Using(new CultureInfo(\"de-DE\"))); Notes EndsWith may appear only in the body of a constraint expression or when the inherited syntax is used. Only one Using modifier may be specified. Attempting to use multiple Using modifiers will throw an InvalidOperationException." |
3346 | 3346 | }, |
3347 | 3347 | "articles/nunit/writing-tests/constraints/EqualConstraint.html": { |
3348 | 3348 | "href": "articles/nunit/writing-tests/constraints/EqualConstraint.html", |
|
3467 | 3467 | "articles/nunit/writing-tests/constraints/StartsWithConstraint.html": { |
3468 | 3468 | "href": "articles/nunit/writing-tests/constraints/StartsWithConstraint.html", |
3469 | 3469 | "title": "StartsWith Constraint | NUnit Docs", |
3470 | | - "summary": "StartsWith Constraint StartsWithConstraint tests for an initial string. Constructor StartsWithConstraint(string expected) Syntax Does.StartWith(string expected) StartsWith(string expected) Modifiers ...IgnoreCase Examples of Use string phrase = \"Make your tests fail before passing!\"; Assert.That(phrase, Does.StartWith(\"Make\")); Assert.That(phrase, Does.Not.StartWith(\"Break\")); Notes StartsWith may appear only in the body of a constraint expression or when the inherited syntax is used." |
| 3470 | + "summary": "StartsWith Constraint StartsWithConstraint tests for an initial string. Constructor StartsWithConstraint(string expected) Syntax Does.StartWith(string expected) StartsWith(string expected) Modifiers ...IgnoreCase ...Using(StringComparison comparisonType) ...Using(CultureInfo culture) Examples of Use string phrase = \"Make your tests fail before passing!\"; Assert.That(phrase, Does.StartWith(\"Make\")); Assert.That(phrase, Does.Not.StartWith(\"Break\")); Specifying a StringComparison Assert.That(\"Hello World!\", Does.StartWith(\"HELLO\").Using(StringComparison.OrdinalIgnoreCase)); Assert.That(\"Hello World!\", Does.StartWith(\"Hello\").Using(StringComparison.Ordinal)); Specifying a CultureInfo The Using(CultureInfo) modifier allows for culture-specific string comparisons. It can be combined with .IgnoreCase for case-insensitive culture-aware comparisons: // Using Turkish culture where 'i' and 'I' have special casing rules Assert.That(\"TITLE text\", Does.StartWith(\"title\").IgnoreCase.Using(new CultureInfo(\"tr-TR\"))); // Culture-specific comparison without case-insensitivity Assert.That(\"Straße Street\", Does.StartWith(\"Straße\").Using(new CultureInfo(\"de-DE\"))); Notes StartsWith may appear only in the body of a constraint expression or when the inherited syntax is used. Only one Using modifier may be specified. Attempting to use multiple Using modifiers will throw an InvalidOperationException." |
3471 | 3471 | }, |
3472 | 3472 | "articles/nunit/writing-tests/constraints/SubPathConstraint.html": { |
3473 | 3473 | "href": "articles/nunit/writing-tests/constraints/SubPathConstraint.html", |
|
3477 | 3477 | "articles/nunit/writing-tests/constraints/SubstringConstraint.html": { |
3478 | 3478 | "href": "articles/nunit/writing-tests/constraints/SubstringConstraint.html", |
3479 | 3479 | "title": "Substring Constraint | NUnit Docs", |
3480 | | - "summary": "Substring Constraint SubstringConstraint tests for a substring. Constructor SubstringConstraint(string expected) Syntax Does.Contain(string expected) Modifiers ...IgnoreCase Examples of Use [Test] public void StringConstraint_Examples() { Assert.That(\"Hello World!\", Does.StartWith(\"Hello\")); Assert.That(\"Hello World!\", Does.EndWith(\"World!\")); Assert.That(\"Hello World!\", Does.Contain(\"lo Wor\")); Assert.That(\"Hello World!\", Does.Match(\"H.*!\")); }" |
| 3480 | + "summary": "Substring Constraint SubstringConstraint tests for a substring. Constructor SubstringConstraint(string expected) Syntax Does.Contain(string expected) Modifiers ...IgnoreCase ...Using(StringComparison comparisonType) ...Using(CultureInfo culture) Examples of Use [Test] public void StringConstraint_Examples() { Assert.That(\"Hello World!\", Does.StartWith(\"Hello\")); Assert.That(\"Hello World!\", Does.EndWith(\"World!\")); Assert.That(\"Hello World!\", Does.Contain(\"lo Wor\")); Assert.That(\"Hello World!\", Does.Match(\"H.*!\")); } Specifying a StringComparison Assert.That(\"Hello World!\", Does.Contain(\"WORLD\").Using(StringComparison.OrdinalIgnoreCase)); Assert.That(\"Hello World!\", Does.Contain(\"World\").Using(StringComparison.Ordinal)); Specifying a CultureInfo The Using(CultureInfo) modifier allows for culture-specific string comparisons. It can be combined with .IgnoreCase for case-insensitive culture-aware comparisons: // Using Turkish culture where 'i' and 'I' have special casing rules Assert.That(\"Hello TITLE World\", Does.Contain(\"title\").IgnoreCase.Using(new CultureInfo(\"tr-TR\"))); // Culture-specific comparison without case-insensitivity Assert.That(\"Straße Street\", Does.Contain(\"Straße\").Using(new CultureInfo(\"de-DE\"))); Notes Only one Using modifier may be specified. Attempting to use multiple Using modifiers will throw an InvalidOperationException." |
3481 | 3481 | }, |
3482 | 3482 | "articles/nunit/writing-tests/constraints/ThrowsConstraint.html": { |
3483 | 3483 | "href": "articles/nunit/writing-tests/constraints/ThrowsConstraint.html", |
|
0 commit comments