Skip to content

Commit

Permalink
move tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Nov 1, 2022
1 parent 75f9fe4 commit 2ecc92b
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Task StreamWithExtension()
return Verify(stream, "png");
}
```
<sup><a href='/src/Verify.Tests/StreamTests.cs#L63-L72' title='Snippet source file'>snippet source</a> | <a href='#snippet-streamwithextension' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/StreamTests.cs#L61-L70' title='Snippet source file'>snippet source</a> | <a href='#snippet-streamwithextension' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

For a `FileStream` the extension is not required:
Expand All @@ -33,7 +33,7 @@ For a `FileStream` the extension is not required:
public Task FileStream() =>
Verify(File.OpenRead("sample.txt"));
```
<sup><a href='/src/Verify.Tests/StreamTests.cs#L74-L80' title='Snippet source file'>snippet source</a> | <a href='#snippet-filestream' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/StreamTests.cs#L72-L78' title='Snippet source file'>snippet source</a> | <a href='#snippet-filestream' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
4 changes: 2 additions & 2 deletions docs/verify-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Verifies the contents of a file.
public Task VerifyFilePath() =>
VerifyFile("sample.txt");
```
<sup><a href='/src/Verify.Tests/StreamTests.cs#L127-L133' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfile' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/StreamTests.cs#L124-L130' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfile' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -33,5 +33,5 @@ public Task VerifyFileWithInfo() =>
"sample.txt",
info: "the info");
```
<sup><a href='/src/Verify.Tests/StreamTests.cs#L146-L154' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfilewithinfo' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/StreamTests.cs#L143-L151' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfilewithinfo' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
14 changes: 7 additions & 7 deletions docs/verify-xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Verifies Xml:
public Task VerifyFilePath() =>
VerifyFile("sample.txt");
```
<sup><a href='/src/Verify.Tests/StreamTests.cs#L127-L133' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfile' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/StreamTests.cs#L124-L130' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfile' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -38,7 +38,7 @@ This code:
public Task Xml() =>
VerifyXml(xml);
```
<sup><a href='/src/Verify.Tests/Serialization/XmlTests.cs#L9-L16' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyxml' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/XmlTests.cs#L9-L16' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyxml' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Will produce
Expand All @@ -50,7 +50,7 @@ Will produce
<node>text</node>
</body>
```
<sup><a href='/src/Verify.Tests/Serialization/XmlTests.Xml.verified.xml#L1-L3' title='Snippet source file'>snippet source</a> | <a href='#snippet-XmlTests.Xml.verified.xml' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/XmlTests.Xml.verified.xml#L1-L3' title='Snippet source file'>snippet source</a> | <a href='#snippet-XmlTests.Xml.verified.xml' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -66,7 +66,7 @@ public Task XmlIgnoreMember() =>
VerifyXml(xml)
.IgnoreMember("node");
```
<sup><a href='/src/Verify.Tests/Serialization/XmlTests.cs#L22-L29' title='Snippet source file'>snippet source</a> | <a href='#snippet-xmlignoremember' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/XmlTests.cs#L22-L29' title='Snippet source file'>snippet source</a> | <a href='#snippet-xmlignoremember' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Will produce
Expand All @@ -76,7 +76,7 @@ Will produce
```xml
<body />
```
<sup><a href='/src/Verify.Tests/Serialization/XmlTests.XmlIgnoreMember.verified.xml#L1-L1' title='Snippet source file'>snippet source</a> | <a href='#snippet-XmlTests.XmlIgnoreMember.verified.xml' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/XmlTests.XmlIgnoreMember.verified.xml#L1-L1' title='Snippet source file'>snippet source</a> | <a href='#snippet-XmlTests.XmlIgnoreMember.verified.xml' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -92,7 +92,7 @@ public Task XmlScrubMember() =>
VerifyXml(xml)
.ScrubMember("node");
```
<sup><a href='/src/Verify.Tests/Serialization/XmlTests.cs#L31-L38' title='Snippet source file'>snippet source</a> | <a href='#snippet-xmlscrubmember' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/XmlTests.cs#L31-L38' title='Snippet source file'>snippet source</a> | <a href='#snippet-xmlscrubmember' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Will produce
Expand All @@ -104,5 +104,5 @@ Will produce
<node>Scrubbed</node>
</body>
```
<sup><a href='/src/Verify.Tests/Serialization/XmlTests.XmlScrubMember.verified.xml#L1-L3' title='Snippet source file'>snippet source</a> | <a href='#snippet-XmlTests.XmlScrubMember.verified.xml' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/XmlTests.XmlScrubMember.verified.xml#L1-L3' title='Snippet source file'>snippet source</a> | <a href='#snippet-XmlTests.XmlScrubMember.verified.xml' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
7 changes: 2 additions & 5 deletions src/Verify.Tests/StreamTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Non-nullable field is uninitialized.

#pragma warning disable CS8618

[UsesVerify]
public class StreamTests
{
Expand All @@ -12,6 +8,7 @@ public class StreamTests
{
1
}));

[Fact]
public Task ByteArray() =>
Verify(
Expand Down Expand Up @@ -49,6 +46,7 @@ public async Task EmptyBinary()
var exception = await Assert.ThrowsAsync<Exception>(() => Verify(Array.Empty<byte>(), "bin"));
Assert.Equal("Empty data is not allowed.", exception.Message);
}

[Fact]
public Task NestedByteArray() =>
Verify(
Expand Down Expand Up @@ -117,7 +115,6 @@ public Task StreamNotAtStartAsText()
},
"bin");


#if !NETFRAMEWORK
[Fact]
public Task VerifyBytesAsync() =>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2ecc92b

Please sign in to comment.