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); }
/// <inheritdoc /> public override bool Equals(CommunicationIdentifier other) => other is MicrosoftTeamsUserIdentifier otherId && otherId.UserId == UserId && otherId.IsAnonymous == IsAnonymous;
/// <inheritdoc /> public override bool Equals(CommunicationIdentifier other) => other is MicrosoftTeamsUserIdentifier otherId &&
/// <inheritdoc /> public override bool Equals(CommunicationIdentifier other) => other is PhoneNumberIdentifier otherId && otherId.PhoneNumber == PhoneNumber && (Id is null || otherId.Id is null || Id == otherId.Id);
/// <inheritdoc /> public override bool Equals(CommunicationIdentifier other) => other is UnknownIdentifier otherId && otherId.Id == Id;
/// <inheritdoc /> public override bool Equals(CommunicationIdentifier other) => other is CallingApplicationIdentifier otherId && otherId.Id == Id;
public static CommunicationIdentifierModel Serialize(CommunicationIdentifier identifier) => identifier switch {
static void AssertCorrectness(UnknownIdentifier expectedIdentifier, CommunicationIdentifier identifier) { Assert.True(identifier is UnknownIdentifier); Assert.AreEqual(expectedIdentifier.Id, ((UnknownIdentifier)identifier).Id); Assert.AreEqual(expectedIdentifier, identifier); }
/// <inheritdoc /> public override bool Equals(CommunicationIdentifier other) => other is PhoneNumberIdentifier otherId && otherId.PhoneNumber == PhoneNumber;