Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Aug 31, 2023
1 parent 6ef74b1 commit 0fc9599
Show file tree
Hide file tree
Showing 33 changed files with 337 additions and 334 deletions.
4 changes: 2 additions & 2 deletions docs/named-tuples.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Given a method that returns a named tuple:
static (bool Member1, string Member2, string Member3) MethodWithNamedTuple() =>
(true, "A", "B");
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1512-L1517' title='Snippet source file'>snippet source</a> | <a href='#snippet-methodwithnamedtuple' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1514-L1519' title='Snippet source file'>snippet source</a> | <a href='#snippet-methodwithnamedtuple' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Can be verified:
Expand All @@ -29,7 +29,7 @@ Can be verified:
```cs
await VerifyTuple(() => MethodWithNamedTuple());
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1505-L1509' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifytuple' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1507-L1511' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifytuple' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Resulting in:
Expand Down
30 changes: 16 additions & 14 deletions docs/naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,27 +449,29 @@ public class ExtensionSample
[Fact]
public Task AtMethod() =>
Verify(
target: @"
<note>
<to>Joe</to>
<from>Kim</from>
<heading>Reminder</heading>
</note>",
target: """
<note>
<to>Joe</to>
<from>Kim</from>
<heading>Reminder</heading>
</note>
""",
extension: "xml");

[Fact]
public Task AtMethodFluent() =>
Verify(
target: @"
<note>
<to>Joe</to>
<from>Kim</from>
<heading>Reminder</heading>
</note>",
target: """
<note>
<to>Joe</to>
<from>Kim</from>
<heading>Reminder</heading>
</note>
""",
extension: "xml");
}
```
<sup><a href='/src/Verify.Xunit.Tests/Snippets/ExtensionSample.cs#L1-L29' title='Snippet source file'>snippet source</a> | <a href='#snippet-xunitextensionsample' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/Snippets/ExtensionSample.cs#L1-L31' title='Snippet source file'>snippet source</a> | <a href='#snippet-xunitextensionsample' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Result in:
Expand All @@ -483,7 +485,7 @@ Result in:
<heading>Reminder</heading>
</note>
```
<sup><a href='/src/Verify.Xunit.Tests/Snippets/ExtensionSample.AtMethod.verified.xml#L1-L6' title='Snippet source file'>snippet source</a> | <a href='#snippet-Verify.Xunit.Tests/Snippets/ExtensionSample.AtMethod.verified.xml' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/Snippets/ExtensionSample.AtMethod.verified.xml#L1-L5' title='Snippet source file'>snippet source</a> | <a href='#snippet-Verify.Xunit.Tests/Snippets/ExtensionSample.AtMethod.verified.xml' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
165 changes: 81 additions & 84 deletions docs/scrubbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ For example remove lines containing `text`:
```cs
verifySettings.ScrubLines(line => line.Contains("text"));
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1355-L1359' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublines' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1357-L1361' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublines' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -74,7 +74,7 @@ For example remove lines containing `text1` or `text2`
```cs
verifySettings.ScrubLinesContaining("text1", "text2");
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1361-L1365' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublinescontaining' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1363-L1367' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublinescontaining' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Case insensitive by default (StringComparison.OrdinalIgnoreCase).
Expand All @@ -86,7 +86,7 @@ Case insensitive by default (StringComparison.OrdinalIgnoreCase).
```cs
verifySettings.ScrubLinesContaining(StringComparison.Ordinal, "text1", "text2");
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1367-L1371' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublinescontainingordinal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1369-L1373' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublinescontainingordinal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -101,7 +101,7 @@ For example converts lines to upper case:
```cs
verifySettings.ScrubLinesWithReplace(line => line.ToUpper());
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1373-L1377' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublineswithreplace' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1375-L1379' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrublineswithreplace' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -114,7 +114,7 @@ Replaces `Environment.MachineName` with `TheMachineName`.
```cs
verifySettings.ScrubMachineName();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1379-L1383' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmachinename' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1381-L1385' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmachinename' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -127,7 +127,7 @@ Replaces `Environment.UserName` with `TheUserName`.
```cs
verifySettings.ScrubUserName();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1385-L1389' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubusername' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1387-L1391' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubusername' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -166,7 +166,7 @@ public class ScrubbersSample
settings.ScrubLinesContaining(StringComparison.Ordinal, "H");
return Verify(
settings: settings,
target: @"
target: """
LineA
LineB
LineC
Expand All @@ -175,7 +175,7 @@ public class ScrubbersSample
LineH
LineI
LineJ
");
""");
}

[Fact]
Expand All @@ -191,17 +191,16 @@ public class ScrubbersSample

[Fact]
public Task LinesFluent() =>
Verify(
target: @"
LineA
LineB
LineC
LineD
LineE
LineH
LineI
LineJ
")
Verify("""
LineA
LineB
LineC
LineD
LineE
LineH
LineI
LineJ
""")
.ScrubLinesWithReplace(
replaceLine: line =>
{
Expand Down Expand Up @@ -244,12 +243,11 @@ public class ScrubbersSample

[Fact]
public Task RemoveOrReplace() =>
Verify(
target: @"
LineA
LineB
LineC
")
Verify("""
LineA
LineB
LineC
""")
.ScrubLinesWithReplace(
replaceLine: line =>
{
Expand All @@ -263,16 +261,17 @@ public class ScrubbersSample

[Fact]
public Task EmptyLines() =>
Verify(
target: @"
LineA
Verify("""
LineC
")
LineA
LineC
""")
.ScrubEmptyLines();
}
```
<sup><a href='/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.cs#L1-L131' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubberssamplexunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.cs#L1-L130' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubberssamplexunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -303,7 +302,7 @@ public class ScrubbersSample
settings.ScrubLinesContaining(StringComparison.Ordinal, "H");
return Verify(
settings: settings,
target: @"
target: """
LineA
LineB
LineC
Expand All @@ -312,22 +311,21 @@ public class ScrubbersSample
LineH
LineI
LineJ
");
""");
}

[Test]
public Task LinesFluent() =>
Verify(
target: @"
LineA
LineB
LineC
LineD
LineE
LineH
LineI
LineJ
")
Verify("""
LineA
LineB
LineC
LineD
LineE
LineH
LineI
LineJ
""")
.ScrubLinesWithReplace(
replaceLine: line =>
{
Expand Down Expand Up @@ -369,12 +367,11 @@ public class ScrubbersSample

[Test]
public Task RemoveOrReplace() =>
Verify(
target: @"
LineA
LineB
LineC
")
Verify("""
LineA
LineB
LineC
""")
.ScrubLinesWithReplace(
replaceLine: line =>
{
Expand All @@ -388,16 +385,17 @@ public class ScrubbersSample

[Test]
public Task EmptyLines() =>
Verify(
target: @"
LineA
Verify("""
LineA
LineC
LineC
")
""")
.ScrubEmptyLines();
}
```
<sup><a href='/src/Verify.NUnit.Tests/Scrubbers/ScrubbersSample.cs#L1-L119' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubberssamplenunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Scrubbers/ScrubbersSample.cs#L1-L118' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubberssamplenunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -429,7 +427,7 @@ public class ScrubbersSample :
settings.ScrubLinesContaining(StringComparison.Ordinal, "H");
return Verify(
settings: settings,
target: @"
target: """
LineA
LineB
LineC
Expand All @@ -438,22 +436,21 @@ public class ScrubbersSample :
LineH
LineI
LineJ
");
""");
}

[TestMethod]
public Task LinesFluent() =>
Verify(
target: @"
LineA
LineB
LineC
LineD
LineE
LineH
LineI
LineJ
")
Verify("""
LineA
LineB
LineC
LineD
LineE
LineH
LineI
LineJ
""")
.ScrubLinesWithReplace(
replaceLine: line =>
{
Expand Down Expand Up @@ -495,12 +492,11 @@ public class ScrubbersSample :

[TestMethod]
public Task RemoveOrReplace() =>
Verify(
target: @"
LineA
LineB
LineC
")
Verify("""
LineA
LineB
LineC
""")
.ScrubLinesWithReplace(
replaceLine: line =>
{
Expand All @@ -514,16 +510,17 @@ public class ScrubbersSample :

[TestMethod]
public Task EmptyLines() =>
Verify(
target: @"
LineA
Verify("""
LineC
")
LineA
LineC
""")
.ScrubEmptyLines();
}
```
<sup><a href='/src/Verify.MSTest.Tests/Scrubbers/ScrubbersSample.cs#L3-L122' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubberssamplemstest' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.MSTest.Tests/Scrubbers/ScrubbersSample.cs#L3-L121' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubberssamplemstest' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -533,11 +530,11 @@ public class ScrubbersSample :
<a id='snippet-Verify.Xunit.Tests/Scrubbers/ScrubbersSample.Lines.verified.txt'></a>
```txt
LineA
LineC
LineC
NoMoreLineE
LineI
LineI
```
<sup><a href='/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.Lines.verified.txt#L1-L6' title='Snippet source file'>snippet source</a> | <a href='#snippet-Verify.Xunit.Tests/Scrubbers/ScrubbersSample.Lines.verified.txt' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.Lines.verified.txt#L1-L4' title='Snippet source file'>snippet source</a> | <a href='#snippet-Verify.Xunit.Tests/Scrubbers/ScrubbersSample.Lines.verified.txt' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

<!-- snippet: Verify.Xunit.Tests/Scrubbers/ScrubbersSample.AfterSerialization.verified.txt -->
Expand Down
Loading

0 comments on commit 0fc9599

Please sign in to comment.