Skip to content

Commit

Permalink
#198 Поправил Likes.GetList()
Browse files Browse the repository at this point in the history
  • Loading branch information
inyutin-maxim committed Feb 17, 2016
1 parent b37f74a commit 9437818
Show file tree
Hide file tree
Showing 3 changed files with 323 additions and 316 deletions.
120 changes: 60 additions & 60 deletions VkNet.Tests/Categories/LikesCategoryTest.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Moq;
using NUnit.Framework;
using VkNet.Categories;
using VkNet.Enums.SafetyEnums;
using VkNet.Model.RequestParams;
using VkNet.Utils;

namespace VkNet.Tests.Categories
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Moq;
using NUnit.Framework;
using VkNet.Categories;
using VkNet.Enums.SafetyEnums;
using VkNet.Model.RequestParams;
using VkNet.Utils;

namespace VkNet.Tests.Categories
{
[TestFixture]
[SuppressMessage("ReSharper", "PublicMembersMustHaveComments")]
Expand All @@ -24,11 +24,11 @@ public void IsLiked_NormalCase()
{
const string url = "https://api.vk.com/method/likes.isLiked?type=post&item_id=701&v=5.44&access_token=token";
const string json =
@"{
response: {
liked: 1,
copied: 0
}
@"{
response: {
liked: 1,
copied: 0
}
}";
var likesCategory = GetMockedLikesCategory(url, json);
bool copied;
Expand All @@ -42,10 +42,10 @@ public void Delete_NormalCase()
{
const string url = "https://api.vk.com/method/likes.delete?type=post&item_id=701&v=5.44&access_token=token";
const string json =
@"{
response: {
likes: 4
}
@"{
response: {
likes: 4
}
}";
var likesCategory = GetMockedLikesCategory(url, json);
var like = likesCategory.Delete(LikeObjectType.Post, 701);
Expand All @@ -57,10 +57,10 @@ public void Add_NormalCase()
{
const string url = "https://api.vk.com/method/likes.add?type=post&item_id=701&v=5.44&access_token=token";
const string json =
@"{
response: {
likes: 5
}
@"{
response: {
likes: 5
}
}";
var likesCategory = GetMockedLikesCategory(url, json);
var like = likesCategory.Add(new LikesAddParams { Type = LikeObjectType.Post, ItemId = 701 });
Expand All @@ -70,13 +70,13 @@ public void Add_NormalCase()
[Test]
public void GetList_NormalCase()
{
const string url = "https://api.vk.com/method/likes.getList?item_id=701&extended=1&v=5.44&access_token=token";
const string url = "https://api.vk.com/method/likes.getList?item_id=701&v=5.44&access_token=token";
const string json =
@"{
response: {
count: 5,
items: [32190123, 221634238, 229027572, 210894192, 201173701]
}
@"{
response: {
count: 5,
items: [32190123, 221634238, 229027572, 210894192, 201173701]
}
}";
var likesCategory = GetMockedLikesCategory(url, json);
var like = likesCategory.GetList(new LikesGetListParams
Expand All @@ -91,36 +91,36 @@ public void GetListEx_NormalCase()
{
const string url = "https://api.vk.com/method/likes.getList?item_id=701&extended=1&v=5.44&access_token=token";
const string json =
@"{
response: {
count: 5,
items: [{
type: 'profile',
id: 32190123,
first_name: 'Максим',
last_name: 'Инютин'
}, {
type: 'profile',
id: 221634238,
first_name: 'Александр',
last_name: 'Инютин'
}, {
type: 'profile',
id: 229027572,
first_name: 'Настя',
last_name: 'Зубова'
}, {
type: 'profile',
id: 210894192,
first_name: 'Елизавета',
last_name: 'Емельянова'
}, {
type: 'profile',
id: 201173701,
first_name: 'Даниил',
last_name: 'Богданов'
}]
}
@"{
response: {
count: 5,
items: [{
type: 'profile',
id: 32190123,
first_name: 'Максим',
last_name: 'Инютин'
}, {
type: 'profile',
id: 221634238,
first_name: 'Александр',
last_name: 'Инютин'
}, {
type: 'profile',
id: 229027572,
first_name: 'Настя',
last_name: 'Зубова'
}, {
type: 'profile',
id: 210894192,
first_name: 'Елизавета',
last_name: 'Емельянова'
}, {
type: 'profile',
id: 201173701,
first_name: 'Даниил',
last_name: 'Богданов'
}]
}
}";
var likesCategory = GetMockedLikesCategory(url, json);
var like = likesCategory.GetListEx(new LikesGetListParams
Expand All @@ -133,5 +133,5 @@ public void GetListEx_NormalCase()
Assert.That(like.Users.First().LastName, Is.EqualTo("Инютин"));
Assert.That(like.Groups.Count, Is.EqualTo(0));
}
}
}
}
Loading

0 comments on commit 9437818

Please sign in to comment.