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


C# Categories.MessagesCategory类代码示例

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


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

示例1: GetDialogs_AccessTokenInvalid_ThrowAccessTokenInvalidException

		public void GetDialogs_AccessTokenInvalid_ThrowAccessTokenInvalidException()
		{
			var cat = new MessagesCategory(new VkApi());
			int totalCount;
			int unreadCount;
			This.Action(() => cat.GetDialogs(out totalCount, out unreadCount, 0, 201)).Throws<AccessTokenInvalidException>();
		}
开发者ID:ProESM,项目名称:vk,代码行数:7,代码来源:MessagesCategoryTest.cs

示例2: GetDialogs_AccessTokenInvalid_ThrowAccessTokenInvalidException

		public void GetDialogs_AccessTokenInvalid_ThrowAccessTokenInvalidException()
		{
			var cat = new MessagesCategory(new VkApi());
			int totalCount;
			int unreadCount;
			Assert.That(() => cat.GetDialogs(out totalCount, out unreadCount, 0, 201), Throws.InstanceOf<AccessTokenInvalidException>());
		}
开发者ID:kadkin,项目名称:vk,代码行数:7,代码来源:MessagesCategoryTest.cs

示例3: MarkAsRead_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void MarkAsRead_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     This.Action(() => cat.MarkAsRead(1)).Throws<AccessTokenInvalidException>();
 }
开发者ID:Olegasdf,项目名称:vk,代码行数:5,代码来源:MessagesCategoryTest.cs

示例4: Get_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void Get_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     int totalCount;
     This.Action(() => cat.Get(MessageType.Received, out totalCount)).Throws<AccessTokenInvalidException>();
 }
开发者ID:Olegasdf,项目名称:vk,代码行数:6,代码来源:MessagesCategoryTest.cs

示例5: GetLastActivity_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void GetLastActivity_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     This.Action(() => cat.GetLastActivity(1)).Throws<AccessTokenInvalidException>();
 }
开发者ID:Olegasdf,项目名称:vk,代码行数:5,代码来源:MessagesCategoryTest.cs

示例6: GetHistory_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void GetHistory_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     int totalCount;
     This.Action(() => cat.GetHistory(out totalCount, false, 1)).Throws<AccessTokenInvalidException>();
 }
开发者ID:Olegasdf,项目名称:vk,代码行数:6,代码来源:MessagesCategoryTest.cs

示例7: GetById_Multiple_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void GetById_Multiple_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     int totalCount;
     This.Action(() => cat.GetById(out totalCount, new ulong[] { 1, 3, 5 })).Throws<AccessTokenInvalidException>();
 }
开发者ID:Olegasdf,项目名称:vk,代码行数:6,代码来源:MessagesCategoryTest.cs

示例8: Delete_Multiple_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void Delete_Multiple_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     This.Action(() => cat.Delete(new ulong[] { 1 })).Throws<AccessTokenInvalidException>();
 }
开发者ID:Olegasdf,项目名称:vk,代码行数:5,代码来源:MessagesCategoryTest.cs

示例9: RemoveChatUser_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void RemoveChatUser_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     cat.RemoveChatUser(2, 2);
 }
开发者ID:justloot,项目名称:vk,代码行数:5,代码来源:MessagesCategoryTest.cs

示例10: MarkAsRead_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void MarkAsRead_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     cat.MarkAsRead(1);
 }
开发者ID:justloot,项目名称:vk,代码行数:5,代码来源:MessagesCategoryTest.cs

示例11: Get_NormalCaseAllFields_Messages

        public void Get_NormalCaseAllFields_Messages()
        {
            url = "https://api.vk.com/method/messages.get?out=0&offset=5&count=3&filters=8&preview_length=100&time_offset=41712634&access_token=token";
            json =
                @"{
                    'response': [
                      2217,
                      {
                        'id': 4434,
                        'date': 1342169928,
                        'out': 0,
                        'user_id': 245242,
                        'read_state': 0,
                        'title': ' ... ',
                        'body': 'собирлись больше'
                      },
                      {
                        'id': 4433,
                        'date': 1342169920,
                        'out': 0,
                        'user_id': 245242,
                        'read_state': 0,
                        'title': ' ... ',
                        'body': 'не особо'
                      },
                      {
                        'id': 4431,
                        'date': 1342169360,
                        'out': 0,
                        'user_id': 245242,
                        'read_state': 1,
                        'title': ' ... ',
                        'body': 'наверное точно для демографии))'
                      }
                    ]
                  }";

            var browser = new Mock<IBrowser>();
            browser.Setup(m => m.GetJson(It.IsAny<string>())).Returns(json);
            var cat = new MessagesCategory(new VkApi {AccessToken = "token", Browser = browser.Object});

            int totalCount;
            var msgs = cat.Get(MessageType.Received, out totalCount, 3, 5, MessagesFilter.Important, 100, new DateTime(2012, 7, 1)).ToList();

            Assert.That(totalCount, Is.EqualTo(2217));
            Assert.That(msgs.Count, Is.EqualTo(3));

            Assert.That(msgs[0].Id, Is.EqualTo(4434));
            Assert.That(msgs[0].Date, Is.EqualTo(new DateTime(2012, 7, 13, 12, 58, 48)));
            Assert.That(msgs[0].Type, Is.EqualTo(MessageType.Received));
            Assert.That(msgs[0].UserId, Is.EqualTo(245242));
            Assert.That(msgs[0].ReadState, Is.EqualTo(MessageReadState.Unreaded));
            Assert.That(msgs[0].Title, Is.EqualTo(" ... "));
            Assert.That(msgs[0].Body, Is.EqualTo("собирлись больше"));

            Assert.That(msgs[1].Id, Is.EqualTo(4433));
            Assert.That(msgs[1].Date, Is.EqualTo(new DateTime(2012, 7, 13, 12, 58, 40)));
            Assert.That(msgs[1].Type, Is.EqualTo(MessageType.Received));
            Assert.That(msgs[1].UserId, Is.EqualTo(245242));
            Assert.That(msgs[1].ReadState, Is.EqualTo(MessageReadState.Unreaded));
            Assert.That(msgs[1].Title, Is.EqualTo(" ... "));
            Assert.That(msgs[1].Body, Is.EqualTo("не особо"));

            Assert.That(msgs[2].Id, Is.EqualTo(4431));
            Assert.That(msgs[2].Date, Is.EqualTo(new DateTime(2012, 7, 13, 12, 49, 20)));
            Assert.That(msgs[2].Type, Is.EqualTo(MessageType.Received));
            Assert.That(msgs[2].UserId, Is.EqualTo(245242));
            Assert.That(msgs[2].ReadState, Is.EqualTo(MessageReadState.Readed));
            Assert.That(msgs[2].Title, Is.EqualTo(" ... "));
            Assert.That(msgs[2].Body, Is.EqualTo("наверное точно для демографии))"));
        }
开发者ID:justloot,项目名称:vk,代码行数:71,代码来源:MessagesCategoryTest.cs

示例12: CreateChat_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void CreateChat_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     cat.CreateChat(new long[] { 1, 2 }, "hi, friends");
 }
开发者ID:justloot,项目名称:vk,代码行数:5,代码来源:MessagesCategoryTest.cs

示例13: GetLastActivity_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void GetLastActivity_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     cat.GetLastActivity(1);
 }
开发者ID:justloot,项目名称:vk,代码行数:5,代码来源:MessagesCategoryTest.cs

示例14: GetHistory_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void GetHistory_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     int totalCount;
     cat.GetHistory(1, false, out totalCount);
 }
开发者ID:justloot,项目名称:vk,代码行数:6,代码来源:MessagesCategoryTest.cs

示例15: GetDialogs_AccessTokenInvalid_ThrowAccessTokenInvalidException

 public void GetDialogs_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var cat = new MessagesCategory(new VkApi());
     int totalCount;
     cat.GetDialogs(1, out totalCount);
 }
开发者ID:justloot,项目名称:vk,代码行数:6,代码来源:MessagesCategoryTest.cs


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