forked from nissl-lab/toxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCnmEmailParserTest.cs
31 lines (27 loc) · 1015 Bytes
/
CnmEmailParserTest.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
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Toxy.Test
{
[TestFixture]
public class CnmEmailParserTest
{
[Test]
public void ReadCnmTest()
{
string path = TestDataSample.GetCNMPath("Y0B6E8H2.CNM");
ParserContext context = new ParserContext(path);
IEmailParser parser = ParserFactory.CreateEmail(context) as IEmailParser;
ToxyEmail email = parser.Parse();
Assert.IsNotNullOrEmpty(email.From);
Assert.AreEqual(1, email.To.Count);
Assert.AreEqual("Тюльпаны <[email protected]>", email.From);
Assert.AreEqual("<[email protected]>", email.To[0]);
Assert.AreEqual("Тюльпаны", email.Subject);
Assert.IsTrue(email.TextBody.StartsWith("Тел: 960-51-57;Продажа тюльпанов"));
Assert.IsTrue(email.HtmlBody.StartsWith("<!DOCTYPE HTML"));
}
}
}