-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSamples.cs
More file actions
57 lines (42 loc) · 1.01 KB
/
Samples.cs
File metadata and controls
57 lines (42 loc) · 1.01 KB
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
[TestFixture]
public class Samples
{
#region VerifyCsv
[Test]
public Task VerifyCsv() =>
VerifyFile("sample.csv");
#endregion
#region IgnoreColumns
[Test]
public Task IgnoreColumns() =>
VerifyFile("sample.csv")
.IgnoreCsvColumns("Customer Id");
#endregion
#region ScrubColumns
[Test]
public Task ScrubCsvColumns() =>
VerifyFile("sample.csv")
.ScrubCsvColumns("Customer Id");
#endregion
#region VerifyCsvStream
[Test]
public Task VerifyCsvStream()
{
var stream = File.OpenRead("sample.csv");
return Verify(stream, "csv");
}
#endregion
static CsvConfiguration config = new(CultureInfo.InvariantCulture)
{
NewLine = "\n"
};
#region VerifyReader
[Test]
public Task VerifyReader()
{
using var reader = File.OpenText("sample.csv");
using var csvReader = new CsvReader(reader, config);
return Verify(csvReader);
}
#endregion
}