コード例 #1
0
        public void SerializePhoneNumber(string?expectedRawId)
        {
            CommunicationIdentifierModel model = CommunicationIdentifierSerializer.Serialize(new PhoneNumberIdentifier(TestPhoneNumber, expectedRawId));

            Assert.AreEqual(TestPhoneNumber, model.PhoneNumber.Value);
            Assert.AreEqual(expectedRawId, model.RawId);
        }
コード例 #2
0
        public void SerializeUnknown()
        {
            CommunicationIdentifierModel model = CommunicationIdentifierSerializer.Serialize(new UnknownIdentifier("some id"));

            Assert.AreEqual(CommunicationIdentifierKind.Unknown, model.Kind);
            Assert.AreEqual("some id", model.Id);
        }
コード例 #3
0
        public void SerializeCommunicationUser()
        {
            CommunicationIdentifierModel model = CommunicationIdentifierSerializer.Serialize(new CommunicationUserIdentifier("some id"));

            Assert.AreEqual(CommunicationIdentifierKind.CommunicationUser, model.Kind);
            Assert.AreEqual("some id", model.Id);
        }
コード例 #4
0
        public void SerializeMicrosoftTeamsUser(bool isAnonymous, string?expectedRawId)
        {
            CommunicationIdentifierModel model = CommunicationIdentifierSerializer.Serialize(new MicrosoftTeamsUserIdentifier(TestTeamsUserId, isAnonymous, CommunicationCloudEnvironment.Dod, expectedRawId));

            Assert.AreEqual(TestTeamsUserId, model.MicrosoftTeamsUser.UserId);
            Assert.AreEqual(CommunicationCloudEnvironmentModel.Dod, model.MicrosoftTeamsUser.Cloud);
            Assert.AreEqual(isAnonymous, model.MicrosoftTeamsUser.IsAnonymous);
            Assert.AreEqual(expectedRawId, model.RawId);
        }
コード例 #5
0
        public void SerializeUnknown()
        {
            CommunicationIdentifierModel model = CommunicationIdentifierSerializer.Serialize(new UnknownIdentifier(TestRawId));

            Assert.AreEqual(TestRawId, model.RawId);
        }
コード例 #6
0
        public void SerializeCommunicationUser()
        {
            CommunicationIdentifierModel model = CommunicationIdentifierSerializer.Serialize(new CommunicationUserIdentifier(TestUserId));

            Assert.AreEqual(TestUserId, model.CommunicationUser.Id);
        }