Exemplo n.º 1
0
        public void testGetThreadId()
        {
            BasicMessageV1_0 testProtocol = BasicMessage.v1_0(
                forRelationship,
                content,
                sentTime,
                localization);

            Assert.IsNotNull(testProtocol.getThreadId());
        }
Exemplo n.º 2
0
        public void testConstructor()
        {
            Context          context      = TestHelpers.getContext();
            BasicMessageV1_0 testProtocol = BasicMessage.v1_0(
                forRelationship,
                content,
                sentTime,
                localization
                );
            JsonObject msg = testProtocol.messageMsg(context);

            testSendMessages(msg);
        }
Exemplo n.º 3
0
        public void testGetMessageType()
        {
            BasicMessageV1_0 testProtocol = BasicMessage.v1_0(
                forRelationship,
                content,
                sentTime,
                localization);

            string msgName = "msg name";
            string msgType = Util.getMessageType(
                Util.COMMUNITY_MSG_QUALIFIER,
                testProtocol.family(),
                testProtocol.version(),
                msgName);

            Assert.AreEqual(msgType, testProtocol.messageType(msgName));
        }
Exemplo n.º 4
0
        public void testSend()
        {
            withContext(context => {
                BasicMessageV1_0 testProtocol = BasicMessage.v1_0(
                    forRelationship,
                    content,
                    sentTime,
                    localization);

                byte[] message             = testProtocol.messageMsgPacked(context);
                JsonObject unpackedMessage = TestHelpers.unpackForwardMessage(context, message);
                testBaseMessage(unpackedMessage);
                Assert.AreEqual(
                    "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/basicmessage/1.0/send-message",
                    unpackedMessage.getAsString("@type")
                    );
            });
        }
Exemplo n.º 5
0
        public void testSend()
        {
            withContext(context => {
                BasicMessageV1_0 testProtocol = BasicMessage.v1_0(
                    forRelationship,
                    content,
                    sentTime,
                    localization);

                byte[] message             = testProtocol.messageMsgPacked(context);
                JsonObject unpackedMessage = TestHelpers.unpackForwardMessage(context, message);
                testBaseMessage(unpackedMessage);
                Assert.AreEqual(
                    Util.COMMUNITY_MSG_QUALIFIER + "/basicmessage/1.0/send-message",
                    unpackedMessage.getAsString("@type")
                    );
            });
        }