private Get ( [ |
||
userIds | [ |
|
fields | ProfileFields | |
nameCase | NameCase | |
skipAuthorization | bool | |
return | ReadOnlyCollection |
public void Get_EmptyAccessToken_ThrowAccessTokenInvalidException() { // Метод Get не требует AccessToken var users = new UsersCategory(new VkApi() { AccessToken = null }); This.Action(() => users.Get(1)).Throws<AccessTokenInvalidException>(); }
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'"); }
public void Get_EmptyAccessToken_ThrowAccessTokenInvalidException() { var users = new UsersCategory(new VkApi()); This.Action(() => users.Get(1)).Throws<AccessTokenInvalidException>(); }
public void Get_EmptyListOfUids_ThrowArgumentNullException() { var users = new UsersCategory(new VkApi { AccessToken = "token" }); IEnumerable<long> userIds = null; This.Action(() => users.Get(userIds)).Throws<ArgumentNullException>(); }
public void Get_Multiple_EmptyAccessToken_ThrowAccessTokenInvalidException() { var users = new UsersCategory(new VkApi()); users.Get(new long[] {1, 2}); }
public void Get_Multiple_EmptyAccessToken_ThrowAccessTokenInvalidException() { var users = new UsersCategory(new VkApi()); Assert.That(() => users.Get(new long[] { 1, 2 }), Throws.InstanceOf<AccessTokenInvalidException>()); }