public async Task Send_Group_Chat_Message_With_Auto_Id_Test() { var mock = new Mock <IStanzaSender>(); XmppXElement result = null; mock.Setup(s => s.SendAsync(It.IsAny <XmppXElement>())) .Callback <XmppXElement>((el) => result = el) .Returns(Task.CompletedTask); await mock.Object.SendGroupChatMessageAsync(new Jid("*****@*****.**"), "hello world", true); result.Cast <Message>().Id.ShouldNotBeNull(); result.Cast <Message>().Id.Length.ShouldBeGreaterThan(1); }