本文整理匯總了C#中Chat.join方法的典型用法代碼示例。如果您正苦於以下問題:C# Chat.join方法的具體用法?C# Chat.join怎麽用?C# Chat.join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Chat
的用法示例。
在下文中一共展示了Chat.join方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: joinTest
public void joinTest()
{
Chat chat = new Chat();
Assert.IsNotNull(chat.Chatters);
Chatter chatter1 = new Chatter(new Guid(), "chatter 1");
chatter1.intId = 0;
Chatter chatter2 = new Chatter(new Guid(), "chatter 2");
chatter1.intId = 1;
chat.join(chatter1);
chat.join(chatter2);
Assert.IsTrue(chat.Chatters.Contains(chatter1), "chatter 1 was not joined");
Assert.IsTrue(chat.Chatters.Contains(chatter2), "chatter 2 was not joined");
}
示例2: newUpdatesTest
public void newUpdatesTest()
{
Chat chat = new Chat();
Assert.IsFalse(chat.newUpdates(1), "Updates for a not existing chatter id");
Chatter chatter = new Chatter(new Guid(), "chatter");
chatter.intId = 2;
chat.join(chatter);
Assert.IsTrue(chat.newUpdates(chatter.intId), "No updates after joining");
chat.iAmUpToDate(chatter.intId);
Assert.IsFalse(chat.newUpdates(chatter.intId), "Updates after call 'I'm up to date'");
chat.SendMessage("hallo");
Assert.IsTrue(chat.newUpdates(chatter.intId), "No updates after receiving a new message");
chat.iAmUpToDate(chatter.intId);
chat.SendMessageTo("hallo", 1);
Assert.IsFalse(chat.newUpdates(chatter.intId), "Updates after whispering to a different chatter");
chat.SendMessageTo("hallo", 2);
Assert.IsTrue(chat.newUpdates(chatter.intId), "No updates after whispering to this chatter");
}
示例3: Join
public void Join(Chat chat)
{
if (!myChats.Contains(chat)) {
chat.join(this);
myChats.Add(chat);
chat.SendMessage("User [b]" + m_name + "[/b] has joined the Chat");
}
}