Get() 개인적인 메소드

private Get ( [ userIds, ProfileFields fields = null, NameCase nameCase = null, bool skipAuthorization = false ) : ReadOnlyCollection
userIds [
fields ProfileFields
nameCase NameCase
skipAuthorization bool
리턴 ReadOnlyCollection
예제 #1
0
		public void Get_EmptyAccessToken_ThrowAccessTokenInvalidException()
        {
			// Метод Get не требует AccessToken
            var users = new UsersCategory(new VkApi() { AccessToken = null });

            This.Action(() => users.Get(1)).Throws<AccessTokenInvalidException>();
        }
예제 #2
0
        public void Get_NotAccessToInternet_ThrowVkApiException()
        {   
            var mockBrowser = new Mock<IBrowser>();
            mockBrowser.Setup(f => f.GetJson(It.IsAny<string>())).Throws(new VkApiException("The remote name could not be resolved: 'api.vk.com'"));

            var users = new UsersCategory(new VkApi {AccessToken = "asgsstsfast", Browser = mockBrowser.Object});

            var ex = This.Action(() => users.Get(1)).Throws<VkApiException>(); 
            ex.Message.ShouldEqual("The remote name could not be resolved: 'api.vk.com'");
        }
예제 #3
0
        public void Get_EmptyAccessToken_ThrowAccessTokenInvalidException()
        {
            var users = new UsersCategory(new VkApi());

            This.Action(() => users.Get(1)).Throws<AccessTokenInvalidException>();
        }
예제 #4
0
 public void Get_EmptyListOfUids_ThrowArgumentNullException()
 {
     var users = new UsersCategory(new VkApi { AccessToken = "token" });
     IEnumerable<long> userIds = null;
     This.Action(() => users.Get(userIds)).Throws<ArgumentNullException>();
 }
예제 #5
0
 public void Get_Multiple_EmptyAccessToken_ThrowAccessTokenInvalidException()
 {
     var users = new UsersCategory(new VkApi());
     users.Get(new long[] {1, 2});
 }
예제 #6
0
        public void Get_Multiple_EmptyAccessToken_ThrowAccessTokenInvalidException()
        {
            var users = new UsersCategory(new VkApi());
			Assert.That(() => users.Get(new long[] { 1, 2 }), Throws.InstanceOf<AccessTokenInvalidException>());
		}