-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRecTests.cs
More file actions
92 lines (81 loc) · 2.68 KB
/
RecTests.cs
File metadata and controls
92 lines (81 loc) · 2.68 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
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
83
84
85
86
87
88
89
90
91
92
using System.Collections.Generic;
using System.IO;
using Xunit;
namespace QuoteParser.Tests
{
public class RecTests : EmailTestBase
{
public RecTests()
: base("recursive")
{
}
protected override QuoteParser CreateQuoteParser()
{
return new QuoteParser.Builder()
.DeleteQuoteMarks(true)
.Recursive(true)
.Build();
}
[Fact]
public void TestEmail270()
{
const int emailNum = 270;
var expectedQuoteHeader = new QuoteHeader(
startIndex: 4,
endIndex: 6,
text: new List<string>
{
"On Tue, Jun 3, 2014 at 11:17 AM, asd asd <",
"asd-asd@asd.com> wrote:"
}
);
var expectedInnerQuoteHeader = new QuoteHeader(
startIndex: 4,
endIndex: 5,
text: new List<string>
{
"In reply to:"
}
);
var content = Parser.Parse(GetResourceTextBody(emailNum));
Assert.Equal(expectedQuoteHeader, content.Header);
Assert.Equal(expectedInnerQuoteHeader, content.Quote?.Header);
}
[Fact]
public void TestEmail6510()
{
const int emailNum = 6510;
var expectedQuoteHeader1 = new QuoteHeader(
startIndex: 2,
endIndex: 3,
text: new List<string>
{
"-----Original Message-----"
}
);
var expectedQuoteHeader2 = new QuoteHeader(
startIndex: 0,
endIndex: 4,
text: new List<string>
{
"From: \"text text (text)\" <text.text@text.com>",
"Sent: Friday, February 13, 2015, 6:44:58 PM",
"To: ",
"Subject: [text] Update: [text-text text] text-123456"
}
);
var expectedQuoteHeader3 = new QuoteHeader(
startIndex: 4,
endIndex: 5,
text: new List<string>
{
"##- Please type your reply above this line -## "
}
);
var content = Parser.Parse(GetResourceTextBody(emailNum));
Assert.Equal(expectedQuoteHeader1, content.Header);
Assert.Equal(expectedQuoteHeader2, content.Quote?.Header);
Assert.Equal(expectedQuoteHeader3, content.Quote?.Quote?.Header);
}
}
}