-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simplified verification for basic types (#176)
- Loading branch information
1 parent
cecec86
commit 0b488bb
Showing
36 changed files
with
299 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.DateTimeWrappedInTask.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2000-01-01T01:01:01+0 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.GuidWrappedInTask.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ebced679-45d3-4653-8791-3d969c4a986c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.NullWrappedInTask.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Boolean.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
True |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.DateTime.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2000-01-01T01:01:01+0 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.DateTimeOffset.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2000-01-01T01:01:01.001+1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Decimal.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Guid.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ebced679-45d3-4653-8791-3d969c4a986c |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Int16.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Int32.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Int64.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Single.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.String.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theString |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.UInt16.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.UInt32.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.Run_arg=System.UInt64.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
3 changes: 3 additions & 0 deletions
3
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Xml.Linq.XDocument.verified.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<body> | ||
<node>text</node> | ||
</body> |
9 changes: 9 additions & 0 deletions
9
src/Verify.Tests/SimpleTypeTests.Run_arg=System.Xml.XmlDocument.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
?xml: { | ||
@version: '1.0', | ||
@encoding: 'UTF-8' | ||
}, | ||
body: { | ||
node: 'text' | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/Verify.Tests/SimpleTypeTests.StringWrappedInTask.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using System.Xml; | ||
using System.Xml.Linq; | ||
using VerifyTests; | ||
using VerifyXunit; | ||
using Xunit; | ||
|
||
[UsesVerify] | ||
public class SimpleTypeTests | ||
{ | ||
[Theory] | ||
[MemberData(nameof(GetData))] | ||
public Task Run(object arg) | ||
{ | ||
var settings = new VerifySettings(); | ||
settings.UseParameters(arg.GetType()); | ||
return Verifier.Verify(arg, settings); | ||
} | ||
|
||
[Fact] | ||
public Task StringWrappedInTask() | ||
{ | ||
return Verifier.Verify(Task.FromResult("theString")); | ||
} | ||
|
||
[Fact] | ||
public Task NullWrappedInTask() | ||
{ | ||
return Verifier.Verify(Task.FromResult<object?>(null)); | ||
} | ||
|
||
[Fact] | ||
public Task Null() | ||
{ | ||
return Verifier.Verify((object?)null); | ||
} | ||
|
||
[Fact] | ||
public Task DateTimeWrappedInTask() | ||
{ | ||
return Verifier.Verify(Task.FromResult(new DateTime(2000, 1, 1, 1, 1, 1, DateTimeKind.Utc))); | ||
} | ||
|
||
[Fact] | ||
public Task GuidWrappedInTask() | ||
{ | ||
return Verifier.Verify(Task.FromResult(new Guid("ebced679-45d3-4653-8791-3d969c4a986c"))); | ||
} | ||
|
||
public static IEnumerable<object[]> GetData() | ||
{ | ||
yield return new object[] {"theString"}; | ||
yield return new object[] {true}; | ||
yield return new object[] {(long) 1}; | ||
yield return new object[] {(short) 1}; | ||
yield return new object[] {1}; | ||
yield return new object[] {(uint) 1}; | ||
yield return new object[] {(ulong) 1}; | ||
yield return new object[] {(ushort) 1}; | ||
yield return new object[] {(decimal) 1}; | ||
yield return new object[] {(float) 1}; | ||
yield return new object[] {new Guid("ebced679-45d3-4653-8791-3d969c4a986c")}; | ||
var xml = @"<?xml version=""1.0"" encoding=""UTF-8""?> | ||
<body> | ||
<node>text</node> | ||
</body>"; | ||
var xmlDocument = new XmlDocument(); | ||
xmlDocument.LoadXml(xml); | ||
yield return new object[] {xmlDocument}; | ||
var xDocument = XDocument.Parse(xml); | ||
yield return new object[] {xDocument}; | ||
yield return new object[] {new DateTime(2000, 1, 1, 1, 1, 1, DateTimeKind.Utc)}; | ||
yield return new object[] {new DateTimeOffset(2000, 1, 1, 1, 1, 1, 1, TimeSpan.FromHours(1))}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
'value' | ||
value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.