File size: 5,082 Bytes
0827183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import aiounittest
from botframework.connector.models import (
    MessageActionsPayloadFrom,
    MessageActionsPayloadBody,
    MessageActionsPayloadAttachment,
    MessageActionsPayloadMention,
    MessageActionsPayloadReaction,
)
from botbuilder.schema.teams import MessageActionsPayload


class TestingMessageActionsPayload(aiounittest.AsyncTestCase):
    # Arrange
    test_id = "01"
    reply_to_id = "test_reply_to_id"
    message_type = "test_message_type"
    created_date_time = "01/01/2000"
    last_modified_date_time = "01/01/2000"
    deleted = False
    subject = "test_subject"
    summary = "test_summary"
    importance = "high"
    locale = "test_locale"
    link_to_message = "https://teams.microsoft/com/l/message/testing-id"
    from_property = MessageActionsPayloadFrom()
    body = MessageActionsPayloadBody
    attachment_layout = "test_attachment_layout"
    attachments = [MessageActionsPayloadAttachment()]
    mentions = [MessageActionsPayloadMention()]
    reactions = [MessageActionsPayloadReaction()]

    # Act
    message = MessageActionsPayload(
        id=test_id,
        reply_to_id=reply_to_id,
        message_type=message_type,
        created_date_time=created_date_time,
        last_modified_date_time=last_modified_date_time,
        deleted=deleted,
        subject=subject,
        summary=summary,
        importance=importance,
        locale=locale,
        link_to_message=link_to_message,
        from_property=from_property,
        body=body,
        attachment_layout=attachment_layout,
        attachments=attachments,
        mentions=mentions,
        reactions=reactions,
    )

    def test_assign_id(self, message_action_payload=message, test_id=test_id):
        # Assert
        self.assertEqual(message_action_payload.id, test_id)

    def test_assign_reply_to_id(
        self, message_action_payload=message, reply_to_id=reply_to_id
    ):
        # Assert
        self.assertEqual(message_action_payload.reply_to_id, reply_to_id)

    def test_assign_message_type(
        self, message_action_payload=message, message_type=message_type
    ):
        # Assert
        self.assertEqual(message_action_payload.message_type, message_type)

    def test_assign_created_date_time(
        self, message_action_payload=message, created_date_time=created_date_time
    ):
        # Assert
        self.assertEqual(message_action_payload.created_date_time, created_date_time)

    def test_assign_last_modified_date_time(
        self,
        message_action_payload=message,
        last_modified_date_time=last_modified_date_time,
    ):
        # Assert
        self.assertEqual(
            message_action_payload.last_modified_date_time, last_modified_date_time
        )

    def test_assign_deleted(self, message_action_payload=message, deleted=deleted):
        # Assert
        self.assertEqual(message_action_payload.deleted, deleted)

    def test_assign_subject(self, message_action_payload=message, subject=subject):
        # Assert
        self.assertEqual(message_action_payload.subject, subject)

    def test_assign_summary(self, message_action_payload=message, summary=summary):
        # Assert
        self.assertEqual(message_action_payload.summary, summary)

    def test_assign_importance(
        self, message_action_payload=message, importance=importance
    ):
        # Assert
        self.assertEqual(message_action_payload.importance, importance)

    def test_assign_locale(self, message_action_payload=message, locale=locale):
        # Assert
        self.assertEqual(message_action_payload.locale, locale)

    def test_assign_link_to_message(
        self, message_action_payload=message, link_to_message=link_to_message
    ):
        # Assert
        self.assertEqual(message_action_payload.link_to_message, link_to_message)

    def test_assign_from_property(
        self, message_action_payload=message, from_property=from_property
    ):
        # Assert
        self.assertEqual(message_action_payload.from_property, from_property)

    def test_assign_body(self, message_action_payload=message, body=body):
        # Assert
        self.assertEqual(message_action_payload.body, body)

    def test_assign_attachment_layout(
        self, message_action_payload=message, attachment_layout=attachment_layout
    ):
        # Assert
        self.assertEqual(message_action_payload.attachment_layout, attachment_layout)

    def test_assign_attachments(
        self, message_action_payload=message, attachments=attachments
    ):
        # Assert
        self.assertEqual(message_action_payload.attachments, attachments)

    def test_assign_mentions(self, message_action_payload=message, mentions=mentions):
        # Assert
        self.assertEqual(message_action_payload.mentions, mentions)

    def test_assign_reactions(
        self, message_action_payload=message, reactions=reactions
    ):
        # Assert
        self.assertEqual(message_action_payload.reactions, reactions)