Skip to content

Commit 7eed078

Browse files
authored
Merge pull request #4464 from CommunityToolkit/aleader/add-toast-scenario-tests
Add tests for toast scenario
2 parents 2d90416 + 25ce670 commit 7eed078

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

UnitTests/UnitTests.Notifications.Shared/Test_Toast_Xml.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,35 @@ public void Test_Toast_XML_Toast_ActivationType_Protocol()
6161
AssertPayload("<toast activationType='protocol' />", toast);
6262
}
6363

64+
[TestMethod]
65+
public void Test_Toast_XML_Toast_Scenario_Default()
66+
{
67+
var toast = new ToastContent()
68+
{
69+
Scenario = ToastScenario.Default
70+
};
71+
72+
AssertPayload("<toast />", toast);
73+
}
74+
75+
[TestMethod]
76+
public void Test_Toast_XML_Toast_Scenarios()
77+
{
78+
AssertToastScenario(ToastScenario.Reminder, "reminder");
79+
AssertToastScenario(ToastScenario.Alarm, "alarm");
80+
AssertToastScenario(ToastScenario.IncomingCall, "incomingCall");
81+
}
82+
83+
private void AssertToastScenario(ToastScenario scenario, string scenarioText)
84+
{
85+
var toast = new ToastContent()
86+
{
87+
Scenario = scenario
88+
};
89+
90+
AssertPayload("<toast scenario='" + scenarioText + "'/>", toast);
91+
}
92+
6493
[TestMethod]
6594
public void Test_Toast_XML_Toast_Duration_Short()
6695
{

0 commit comments

Comments
 (0)