-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSamples.cs
More file actions
103 lines (92 loc) · 2.79 KB
/
Samples.cs
File metadata and controls
103 lines (92 loc) · 2.79 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
93
94
95
96
97
98
99
100
101
102
103
using VerifyTests.EmailPreviewServices;
[TestFixture]
public class Samples
{
#region html
static string html =
"""
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Email</title>
</head>
<body style="font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 20px;">
<div style="max-width: 600px; margin: 0 auto; background-color: white; padding: 20px; border-radius: 10px;">
<h1 style="color: #333;">Welcome to Our Service!</h1>
<p style="color: #666; line-height: 1.6;">
This is a test email to demonstrate the email preview functionality.
</p>
<a href="https://"
style="display: inline-block; padding: 10px 20px; background-color: #007bff;
color: white; text-decoration: none; border-radius: 5px; margin-top: 10px;">
Get Started
</a>
</div>
</body>
</html>
""";
#endregion
[Test]
[Explicit]
public async Task BuildDeviceEnum()
{
var devices = await Builder.Service.GetDeviceListAsync();
var stringBuilder = new StringBuilder();
foreach (var device in devices.OrderBy(_ => _.Name))
{
var name = device.Name
.Replace("Seznam.cz", "Seznam")
.Replace("Freenet.de", "Freenet")
.Replace("Microsoft Outlook", "Outlook")
.Replace(")", "")
.Replace("\"", "")
.Replace(" ", "")
.Replace("(", "")
.Replace("Outlook.com", "OutlookWeb")
.Replace(".", "");
stringBuilder.AppendLine(
$"""
[Description("{device.DeviceKey}")]
{name},
""");
}
await Verify(stringBuilder);
}
[Test]
[Explicit]
public async Task EmailList()
{
var devices = await Builder.Service.GetEmailsAsync();
await Verify(devices);
}
[Test]
[Explicit]
public async Task GenerateAll([Values] Device device)
{
var preview = new EmailPreview
{
Html = html,
Devices = [device]
};
await Verify(preview);
}
#region sample
[Test]
[Explicit]
public async Task GeneratePreview()
{
var preview = new EmailPreview
{
Html = html,
Devices =
[
Device.OutlookWebDarkModeChrome,
Device.iPhone13
]
};
await Verify(preview);
}
#endregion
}