-
-
Notifications
You must be signed in to change notification settings - Fork 156
/
Copy pathScrubbersSample.cs
56 lines (53 loc) · 1.26 KB
/
ScrubbersSample.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
using System;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VerifyTests;
using VerifyMSTest;
#region ScrubbersSampleMSTest
[TestClass]
public class ScrubbersSample :
VerifyBase
{
[TestMethod]
public Task Lines()
{
var settings = new VerifySettings();
settings.ScrubLinesWithReplace(
replaceLine: line =>
{
if (line == "LineE")
{
return "NoMoreLineE";
}
return line;
});
settings.ScrubLines(removeLine: line => line.Contains("J"));
settings.ScrubLinesContaining("b", "D");
settings.ScrubLinesContaining(StringComparison.Ordinal, "H");
return Verify(
settings: settings,
target: @"
LineA
LineB
LineC
LineD
LineE
LineH
LineI
LineJ
");
}
[TestMethod]
public Task ScrubberAppliedAfterJsonSerialization()
{
var target = new ToBeScrubbed
{
RowVersion = "0x00000000000007D3"
};
var settings = new VerifySettings();
settings.AddScrubber(
input => input.Replace("0x00000000000007D3", "TheRowVersion"));
return Verify(target, settings);
}
}
#endregion