Пример #1
0
        public void ResolveScreenName_Group()
        {
            const string url  = "https://api.vk.com/method/utils.resolveScreenName?screen_name=mdk&access_token=";
            const string json =
                @"{
                    'response': {
                      'type': 'group',
                      'object_id': 10639516.0
                    }
                  }";

            var utils = GetMockedUtilsCategory(url, json);

            VkObject obj = utils.ResolveScreenName("mdk");

            // assert
            obj.ShouldNotBeNull();
            obj.Type.ShouldEqual(VkObjectType.Group);
            obj.Id.ShouldEqual(10639516);
        }
Пример #2
0
        public void ResolveScreenName_ObjectIdIsVeryBig_User()
        {
            const string url  = "https://api.vk.com/method/utils.resolveScreenName?screen_name=azhidkov&access_token=";
            const string json =
                @"{
                    'response': {
                      'type': 'user',
                      'object_id': 922337203685471.0
                    }
                  }";

            var utils = GetMockedUtilsCategory(url, json);

            VkObject obj = utils.ResolveScreenName("azhidkov");

            // assert
            obj.ShouldNotBeNull();
            obj.Id.ShouldEqual(922337203685471);
            obj.Type.ShouldEqual(VkObjectType.User);
        }