Example #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);
        }
Example #2
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is MicrosoftTeamsUserIdentifier otherId && otherId.UserId == UserId && otherId.IsAnonymous == IsAnonymous;
Example #3
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is MicrosoftTeamsUserIdentifier otherId &&
Example #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);
Example #5
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is UnknownIdentifier otherId && otherId.Id == Id;
Example #6
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is CallingApplicationIdentifier otherId && otherId.Id == Id;
 public static CommunicationIdentifierModel Serialize(CommunicationIdentifier identifier)
 => identifier switch
 {
Example #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);
 }
Example #9
0
 /// <inheritdoc />
 public override bool Equals(CommunicationIdentifier other)
 => other is PhoneNumberIdentifier otherId && otherId.PhoneNumber == PhoneNumber;