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


C# HipChat.HipChatClient类代码示例

本文整理汇总了C#中HipChat.HipChatClient的典型用法代码示例。如果您正苦于以下问题:C# HipChatClient类的具体用法?C# HipChatClient怎么用?C# HipChatClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HipChatClient类属于HipChat命名空间,在下文中一共展示了HipChatClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestListRoomsAsNativeObjects

 public void TestListRoomsAsNativeObjects()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token, HipChat.HipChatClient.ApiResponseFormat.XML);
     var rooms = client.ListRoomsAsNativeObjects();
     Assert.IsInstanceOfType(rooms, typeof(List<HipChat.Entities.Room>));
     Assert.IsTrue(rooms.Count > 0); //HACK: the number of rooms is variable, so just check that it's greater than 0 - bit if a hack
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:7,代码来源:ClientTests.cs

示例2: TestListRoomsAsJson

 public void TestListRoomsAsJson()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token, HipChat.HipChatClient.ApiResponseFormat.JSON);
     var json = client.ListRooms();
     // not the most scientific test, but it's sunday night
     Assert.IsTrue(json.Contains("{"));
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:7,代码来源:ClientTests.cs

示例3: TestListRoomsAsXml

 public void TestListRoomsAsXml()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token, HipChat.HipChatClient.ApiResponseFormat.XML);
     var xml = client.ListRooms();
     // not the most scientific test, but it's sunday night
     Assert.IsTrue(xml.StartsWith("<?xml version=\"1.0\" encoding=\"utf-8\"?>"));
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:7,代码来源:ClientTests.cs

示例4: TestWindsorInstaller

        public static void TestWindsorInstaller(TestContext context)
        {
            IWindsorContainer container = new WindsorContainer();
            container.Install(new HipChatClientInstaller());
            defaultClient = container.Resolve<HipChatClient>("ChatClient");
            defaultClient.From += defaultClient.GetHashCode().ToString();
//            defaultClient.SendMessage("TestWindsorInstaller");
        }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:8,代码来源:ClientTests.cs

示例5: HipChatNotifier

 public HipChatNotifier(IConfigurationProvider configurationProvider)
 {
     _configurationProvider = configurationProvider;
     _hipChatClient = new HipChatClient
     {
         Token = _configurationProvider.Config.HipChatToken,
     };
 }
开发者ID:ryascl,项目名称:tfs-hipchat,代码行数:8,代码来源:HipChatNotifier.cs

示例6: TestYieldRooms

 public void TestYieldRooms()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token);
     var x = 0;
     foreach (HipChat.Entities.Room room in client.YieldRooms())
     {
         x++;
     }
     Assert.IsTrue(x > 0);
 }
开发者ID:tekmaven,项目名称:HipChat.net,代码行数:10,代码来源:ClientTests.cs

示例7: SendNotification

        public void SendNotification(string sourceName, string notification)
        {
            var client = new HipChatClient(_authToken, _roomId, sourceName)
            {
                Notify = false,
                Color = HipChatClient.BackgroundColor.random
            };

            client.SendMessage(notification);
        }
开发者ID:pimterry,项目名称:hipchat-filterer,代码行数:10,代码来源:HipchatNotificationTarget.cs

示例8: HipChatService

        public HipChatService(string setAPIKEY)
        {
            APIKEY = setAPIKEY;
            OPERATION_ACTIVE = false;
            ticker.Elapsed += new ElapsedEventHandler(getChatHistory);
            ticker.Interval = 60000;

            theClient = new HipChatClient(APIKEY, HIPCHATROOM, HIPCHATUSERNAME);

            try
            {
                Console.WriteLine(DateTime.Now + "[Chat] Initialized");
                parseRoomHistory(theClient.ListHistoryAsNativeObjects());
                // set the firstrun flag to false
                // doing so will prevent the buffer-overflow.
                FIRSTRUN = false;
                CHAT_INITERFACE_ACTIVE = true;
            }
            catch
            {
                Console.WriteLine(DateTime.Now + "[CHAT] Unable to initialize");
                CHAT_INITERFACE_ACTIVE = false;
            }
        }
开发者ID:mikebosco,项目名称:OctoBot,代码行数:24,代码来源:HipChatService.cs

示例9: TestSendMessageEmptyException

 public void TestSendMessageEmptyException()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token);
     client.SendMessage("", defaultClient.RoomId, defaultClient.From);
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例10: TestSenderLengthTruncate

 public void TestSenderLengthTruncate()
 {
     var client = new HipChat.HipChatClient("X");
     client.From = "ABCDEFGHIJKLMNOP";
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例11: TestSenderLengthExecption

 public void TestSenderLengthExecption()
 {
     var client = new HipChat.HipChatClient("X");
     client.AutoTruncate = false;
     client.From = "ABCDEFGHIJKLMNOP";
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:6,代码来源:ClientTests.cs

示例12: TestAuthenticationException

 public void TestAuthenticationException()
 {
     var client = new HipChatClient(){Token="XYZ", RoomId=123};
     client.ListRooms();
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例13: TestSendMessage_HtmlMessage

		public void TestSendMessage_HtmlMessage()
		{
			var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From);
			client.SendMessage(MethodBase.GetCurrentMethod().Name + " <a href='http://en.wikiquote.org/wiki/Pulp_Fiction#Dialogue'>Quotable &amp; questionable (?) gems from &quot;Pulp Fiction&quot;</a> =)");
		}
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例14: TestSendMessage_Message_green_notify

 public void TestSendMessage_Message_green_notify()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From);
     client.SendMessage(MethodBase.GetCurrentMethod().Name, HipChatClient.BackgroundColor.green, true);
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例15: TestSendMessage_UnicodeAuthorAndMessage

		public void TestSendMessage_UnicodeAuthorAndMessage()
		{
			var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, "lǝʌɐd ツ");
			client.SendMessage(MethodBase.GetCurrentMethod().Name + " ಠ_ಠ");
		}
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs


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