Методы для работы с сообществами (группами).
示例#1
0
		public void Search_EmptyQuery_ThrowsArgumentException()
		{
			int totalCount;

			var groups = new GroupsCategory(new VkApi { AccessToken = "token" });
			This.Action(() => groups.Search("", out totalCount)).Throws<ArgumentNullException>();
		}
示例#2
0
		public void GetById_Multiple_AccessTokenInvalid_ThrowAccessTokenInvalidException()
		{
			var groups = new GroupsCategory(new VkApi());
			This.Action(() => groups.GetById(2)).Throws<AccessTokenInvalidException>();
		}
示例#3
0
		public void IsMember_AccessTokenInvalid_ThrowAccessTokenInvalidException()
		{
			var g = new GroupsCategory(new VkApi());
			This.Action(() => g.IsMember(2, 1)).Throws<AccessTokenInvalidException>();
		}
示例#4
0
		public void Search_AccessTokenInvalid_ThrowAccessTokenInvalidException()
		{
			int totalCount;
			var groups = new GroupsCategory(new VkApi());
			This.Action(() => groups.Search("Music", out totalCount)).Throws<AccessTokenInvalidException>();
		}
示例#5
0
 public void GetById_Multiple_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var groups = new GroupsCategory(new VkApi());
     Assert.That(() => groups.GetById(2), Throws.InstanceOf<AccessTokenInvalidException>());
 }
示例#6
0
		public void Leave_AccessTokenInvalid_ThrowAccessTokenInvalidException()
		{
			var groups = new GroupsCategory(new VkApi());
			This.Action(() => groups.Leave(1)).Throws<AccessTokenInvalidException>();
		}
示例#7
0
 public void Leave_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var groups = new GroupsCategory(new VkApi());
     Assert.That(() => groups.Leave(1), Throws.InstanceOf<AccessTokenInvalidException>());
 }
示例#8
0
        public void Search_EmptyQuery_ThrowsArgumentException()
        {
            int totalCount;

            var groups = new GroupsCategory(Api);
            Assert.That(() => groups.Search("", out totalCount), Throws.InstanceOf<ArgumentNullException>());
        }
示例#9
0
文件: VkApi.cs 项目: vknet/vk
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi(ICaptchaSolver captchaSolver = null)
        {
            Browser = new Browser();

            Users = new UsersCategory(this);
            Friends = new FriendsCategory(this);
            Status = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups = new GroupsCategory(this);
            Audio = new AudioCategory(this);
            Wall = new WallCategory(this);
            Board = new BoardCategory(this);
            Database = new DatabaseCategory(this);
            Utils = new UtilsCategory(this);
            Fave = new FaveCategory(this);
            Video = new VideoCategory(this);
            Account = new AccountCategory(this);
            Photo = new PhotoCategory(this);
            Docs = new DocsCategory(this);
            Likes = new LikesCategory(this);
            Pages = new PagesCategory(this);
            Gifts = new GiftsCategory(this);
            Apps = new AppsCategory(this);
            NewsFeed = new NewsFeedCategory(this);
            Stats = new StatsCategory(this);
            Auth = new AuthCategory(this);
            Markets = new MarketsCategory(this);
            Execute = new ExecuteCategory(this);

            RequestsPerSecond = 3;

            MaxCaptchaRecognitionCount = 5;
            _captchaSolver = captchaSolver;
        }
示例#10
0
 public void Leave_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var groups = new GroupsCategory(new VkApi());
     groups.Leave(1);
 }
示例#11
0
 public void GetById_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var groups = new GroupsCategory(new VkApi());
     groups.GetById(1);
 }
示例#12
0
 public void IsMember_AccessTokenInvalid_ThrowAccessTokenInvalidException()
 {
     var g = new GroupsCategory(new VkApi());
     g.IsMember(2, 1);
 }
示例#13
0
        public void Search_EmptyQuery_ThrowsArgumentException()
        {
            int totalCount;

            var groups = new GroupsCategory(new VkApi { AccessToken = "token" });
            groups.Search("", out totalCount);
        }