当前位置: 首页>>代码示例>>C#>>正文


C# Chat.join方法代码示例

本文整理汇总了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");
 }
开发者ID:Andi1986,项目名称:ChatApp,代码行数:13,代码来源:Chat_offlineTest.cs

示例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");
 }
开发者ID:Andi1986,项目名称:ChatApp,代码行数:18,代码来源:Chat_offlineTest.cs

示例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");
     }
 }
开发者ID:Andi1986,项目名称:ChatApp,代码行数:8,代码来源:Chatter.cs


注:本文中的Chat.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。