Ejemplo n.º 1
0
		public async Task TestGetObjectOneObject()
		{
			var settProv= new ApiSettingsJsonFileProvider("Api/Settings/Vk.json");
			var apiRequest = new VkApiRequest();
			IApi api = new VkApi(apiRequest, settProv);

			var result = await api.Get<List<VkUser>>("users.get", "1");

			Assert.AreEqual(1, result.Count);
			Assert.AreEqual(1, result[0].Id);
			Assert.AreEqual("durov", result[0].ScreenName);
		}
Ejemplo n.º 2
0
		public async Task TestGetObjectVkList()
		{
			var settProv = new ApiSettingsJsonFileProvider("Api/Settings/Vk.json");
			var apiRequest = new VkApiRequest();
			IApi api = new VkApi(apiRequest, settProv);

			var result = await api.Get<VkList<VkPost>>("wall.get", "174111803");

			Assert.AreEqual(305, result.Count);
			Assert.AreEqual(305, result.Items.Count);
			Assert.AreEqual(536, result.Items[0].Id);
			Assert.AreEqual(185202286, result.Items[0].FromId);
		}