Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 8a7527f

Browse files
committed
add comments to MessageActionsPayload tests
1 parent d6f5821 commit 8a7527f

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

libraries/bot-schema/src/test/java/com/microsoft/bot/schema/teams/MessageActionsPayloadTest.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99
import java.util.ArrayList;
1010
import java.util.List;
1111

12+
/**
13+
* Tests to ensure that MessageActionsPayload works as expected.
14+
*/
1215
public class MessageActionsPayloadTest {
16+
/**
17+
* Ensures the constructor of the MessageActionsPayload class works as expected.
18+
*/
1319
@Test
1420
public void TestMessageActionPayloadConstructor(){
1521
MessageActionsPayload messageActionsPayload = new MessageActionsPayload();
1622
Assert.assertNotNull(messageActionsPayload);
1723
}
1824

25+
/**
26+
* Ensures that the Id property can be set and retrieved.
27+
*/
1928
@Test
2029
public void TestGetId(){
2130
String id = "testId";
@@ -29,6 +38,9 @@ public void TestGetId(){
2938
Assert.assertEquals(result, id);
3039
}
3140

41+
/**
42+
* Ensures that the ReplyToId property can be set and retrieved.
43+
*/
3244
@Test
3345
public void TestGetReplyToId(){
3446
String replyToId = "testReplyToId";
@@ -42,6 +54,9 @@ public void TestGetReplyToId(){
4254
Assert.assertEquals(result, replyToId);
4355
}
4456

57+
/**
58+
* Ensures that the MessageType property can be set and retrieved.
59+
*/
4560
@Test
4661
public void TestGetMessageType(){
4762
String messageType = "testMessageType";
@@ -55,6 +70,9 @@ public void TestGetMessageType(){
5570
Assert.assertEquals(result, messageType);
5671
}
5772

73+
/**
74+
* Ensures that the CreatedDateTime property can be set and retrieved.
75+
*/
5876
@Test
5977
public void TestGetCreatedDateTime(){
6078
String createdDateTime = "2000-01-01";
@@ -68,6 +86,9 @@ public void TestGetCreatedDateTime(){
6886
Assert.assertEquals(result, createdDateTime);
6987
}
7088

89+
/**
90+
* Ensures that the LastModifiedDateTime property can be set and retrieved.
91+
*/
7192
@Test
7293
public void TestGetLastModifiedDateTime(){
7394
String lastModifiedDateTime = "2000-01-01";
@@ -81,6 +102,9 @@ public void TestGetLastModifiedDateTime(){
81102
Assert.assertEquals(result, lastModifiedDateTime);
82103
}
83104

105+
/**
106+
* Ensures that the Deleted property can be set and retrieved.
107+
*/
84108
@Test
85109
public void TestGetDeleted(){
86110
Boolean deleted = false;
@@ -94,6 +118,9 @@ public void TestGetDeleted(){
94118
Assert.assertEquals(result, deleted);
95119
}
96120

121+
/**
122+
* Ensures that the Subject property can be set and retrieved.
123+
*/
97124
@Test
98125
public void TestGetSubject(){
99126
String subject = "testSubject";
@@ -107,6 +134,9 @@ public void TestGetSubject(){
107134
Assert.assertEquals(result, subject);
108135
}
109136

137+
/**
138+
* Ensures that the Summary property can be set and retrieved.
139+
*/
110140
@Test
111141
public void TestGetSummary(){
112142
String summary = "testSummary";
@@ -120,6 +150,9 @@ public void TestGetSummary(){
120150
Assert.assertEquals(result, summary);
121151
}
122152

153+
/**
154+
* Ensures that the Importance property can be set and retrieved.
155+
*/
123156
@Test
124157
public void TestGetImportance(){
125158
String importance = "normal";
@@ -133,6 +166,9 @@ public void TestGetImportance(){
133166
Assert.assertEquals(result, importance);
134167
}
135168

169+
/**
170+
* Ensures that the LinkToMessage property can be set and retrieved.
171+
*/
136172
@Test
137173
public void TestGetLinkToMessage(){
138174
String linkToMessage = "https://teams.microsoft.com/l/message/testing-id";
@@ -146,6 +182,9 @@ public void TestGetLinkToMessage(){
146182
Assert.assertEquals(result, linkToMessage);
147183
}
148184

185+
/**
186+
* Ensures that the Locale property can be set and retrieved.
187+
*/
149188
@Test
150189
public void TestGetLocale(){
151190
String locale = "US";
@@ -159,6 +198,9 @@ public void TestGetLocale(){
159198
Assert.assertEquals(result, locale);
160199
}
161200

201+
/**
202+
* Ensures that the From property can be set and retrieved.
203+
*/
162204
@Test
163205
public void TestGetFrom(){
164206
MessageActionsPayloadFrom from = new MessageActionsPayloadFrom();
@@ -172,6 +214,9 @@ public void TestGetFrom(){
172214
Assert.assertEquals(result, from);
173215
}
174216

217+
/**
218+
* Ensures that the Body property can be set and retrieved.
219+
*/
175220
@Test
176221
public void TestGetBody(){
177222
MessageActionsPayloadBody body = new MessageActionsPayloadBody();
@@ -185,6 +230,9 @@ public void TestGetBody(){
185230
Assert.assertEquals(result, body);
186231
}
187232

233+
/**
234+
* Ensures that the AttachmentLayout property can be set and retrieved.
235+
*/
188236
@Test
189237
public void TestGetAttachmentLayout(){
190238
String attachmentLayout = "testAttachmentLayout";
@@ -198,6 +246,9 @@ public void TestGetAttachmentLayout(){
198246
Assert.assertEquals(result, attachmentLayout);
199247
}
200248

249+
/**
250+
* Ensures that the Attachments property can be set and retrieved.
251+
*/
201252
@Test
202253
public void TestGetAttachments(){
203254
List<MessageActionsPayloadAttachment> attachments = new ArrayList<MessageActionsPayloadAttachment>();
@@ -211,6 +262,9 @@ public void TestGetAttachments(){
211262
Assert.assertEquals(result, attachments);
212263
}
213264

265+
/**
266+
* Ensures that the Mentions property can be set and retrieved.
267+
*/
214268
@Test
215269
public void TestGetMentions(){
216270
List<MessageActionsPayloadMention> mentions = new ArrayList<MessageActionsPayloadMention>();
@@ -224,6 +278,9 @@ public void TestGetMentions(){
224278
Assert.assertEquals(result, mentions);
225279
}
226280

281+
/**
282+
* Ensures that the Reactions property can be set and retrieved.
283+
*/
227284
@Test
228285
public void TestGetReactions(){
229286
List<MessageActionsPayloadReaction> reactions = new ArrayList<MessageActionsPayloadReaction>();

0 commit comments

Comments
 (0)