コード例 #1
0
        public void DeserializeCommunicationUser()
        {
            CommunicationIdentifier identifier = CommunicationIdentifierSerializer.Deserialize(
                new CommunicationIdentifierModel(CommunicationIdentifierKind.CommunicationUser)
            {
                Id = "some id",
            });

            CommunicationUserIdentifier expectedIdentifier = new CommunicationUserIdentifier("some id");

            Assert.True(identifier is CommunicationUserIdentifier);
            Assert.AreEqual(expectedIdentifier.Id, ((CommunicationUserIdentifier)identifier).Id);
            Assert.AreEqual(expectedIdentifier, identifier);
        }
コード例 #2
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is MicrosoftTeamsUserIdentifier otherId && otherId.UserId == UserId && otherId.IsAnonymous == IsAnonymous;
コード例 #3
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is MicrosoftTeamsUserIdentifier otherId &&
コード例 #4
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is PhoneNumberIdentifier otherId && otherId.PhoneNumber == PhoneNumber && (Id is null || otherId.Id is null || Id == otherId.Id);
コード例 #5
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is UnknownIdentifier otherId && otherId.Id == Id;
コード例 #6
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is CallingApplicationIdentifier otherId && otherId.Id == Id;
コード例 #7
0
 public static CommunicationIdentifierModel Serialize(CommunicationIdentifier identifier)
 => identifier switch
 {
コード例 #8
0
 static void AssertCorrectness(UnknownIdentifier expectedIdentifier, CommunicationIdentifier identifier)
 {
     Assert.True(identifier is UnknownIdentifier);
     Assert.AreEqual(expectedIdentifier.Id, ((UnknownIdentifier)identifier).Id);
     Assert.AreEqual(expectedIdentifier, identifier);
 }
コード例 #9
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is PhoneNumberIdentifier otherId && otherId.PhoneNumber == PhoneNumber;