-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathStringContentTests.cs
58 lines (50 loc) · 1.25 KB
/
StringContentTests.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using PSDocs.Runtime;
namespace PSDocs
{
public sealed class StringContentTests
{
[Fact]
public void ReadLines()
{
var lines = new StringContent(GetTestString1()).ReadLines();
Assert.Equal("Line 1", lines[0]);
Assert.Equal("Line 2", lines[1]);
Assert.Equal("Line 3", lines[2]);
lines = new StringContent(GetTestString2()).ReadLines();
Assert.Equal("Line1", lines[0]);
Assert.Equal("Line2", lines[1]);
Assert.Equal(" Line3", lines[2]);
lines = new StringContent(GetTestString3()).ReadLines();
Assert.Equal("Line 1", lines[0]);
Assert.Equal("Line 2", lines[1]);
Assert.Equal(string.Empty, lines[2]);
Assert.Equal("Line 3", lines[3]);
}
private static string GetTestString1()
{
return @"
Line 1
Line 2
Line 3
";
}
private static string GetTestString2()
{
return @"
Line1
Line2
Line3
";
}
private static string GetTestString3()
{
return @"
Line 1
Line 2
Line 3
";
}
}
}