forked from VerifyTests/Verify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParametersSample.cs
82 lines (70 loc) · 1.67 KB
/
ParametersSample.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[UsesVerify]
public class ParametersSample
{
public static IEnumerable<object[]> GetDecimalData()
{
yield return new object[] {(decimal) 1.1};
}
[Theory]
[MemberData(nameof(GetDecimalData))]
public async Task Decimal(decimal arg)
{
await Verify(arg)
.UseParameters(arg);
}
[Theory]
[InlineData((float) 1.1)]
public async Task Float(float arg)
{
await Verify(arg)
.UseParameters(arg);
}
[Theory]
[InlineData(1.1d)]
public async Task Double(double arg)
{
await Verify(arg)
.UseParameters(arg);
}
#region xunitInlineData
[Theory]
[InlineData("Value1")]
[InlineData("Value2")]
public Task InlineDataUsage(string arg)
{
var settings = new VerifySettings();
settings.UseParameters(arg);
return Verify(arg, settings);
}
[Theory]
[InlineData("Value1")]
[InlineData("Value2")]
public Task InlineDataUsageFluent(string arg)
{
return Verify(arg)
.UseParameters(arg);
}
#endregion
#region xunitMemberData
[Theory]
[MemberData(nameof(GetData))]
public Task MemberDataUsage(string arg)
{
var settings = new VerifySettings();
settings.UseParameters(arg);
return Verify(arg, settings);
}
[Theory]
[MemberData(nameof(GetData))]
public Task MemberDataUsageFluent(string arg)
{
return Verify(arg)
.UseParameters(arg);
}
public static IEnumerable<object[]> GetData()
{
yield return new object[] {"Value1"};
yield return new object[] {"Value2"};
}
#endregion
}