This repository was archived by the owner on Jun 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathBlogApiTest.java
123 lines (106 loc) · 2.51 KB
/
BlogApiTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package rae.com.cnblogs.sdk;
import com.github.raee.runit.AndroidRUnit4ClassRunner;
import com.rae.cnblogs.sdk.api.IBlogApi;
import com.rae.cnblogs.sdk.api.ICategoryApi;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* 博客测试
* Created by ChenRui on 2016/11/30 00:15.
*/
@RunWith(AndroidRUnit4ClassRunner.class)
public class BlogApiTest extends BaseTest {
private IBlogApi mApi;
@Override
@Before
public void setup() {
super.setup();
mApi = getApiProvider().getBlogApi();
}
/**
* 获取分类
*/
@Test
public void testBlogInfo() {
runTest("testBlogInfo", mApi.getBlog("https://www.cnblogs.com/zx3180/p/9121204.html"));
}
/**
* 获取分类
*/
@Test
public void testCategory() {
ICategoryApi api = getApiProvider().getCategoriesApi();
runTest("testCategory", api.getCategories());
}
/**
* 首页博客列表
*/
@Test
public void testHomeBlogs() {
runTest("testHomeBlogs", mApi.getBlogList(1, null, null, null));
}
/**
* 博文内容
*/
@Test
public void testContent() {
runTest("testContent", mApi.getBlogContent("6246780"));
}
/**
* 博客评论列表
*/
@Test
public void testComment() {
runTest("testComment", mApi.getBlogComments(1, "574285", "pengze0902"));
}
/**
* 知识库列表
*/
@Test
public void testKB() {
runTest("testKB", mApi.getKbArticles(1));
}
/**
* 知识库内容
*/
@Test
public void testKBContent() {
runTest("testKBContent", mApi.getKbContent("569056"));
}
/**
* 博文点赞
*/
@Test
public void testLikeBlog() {
runTest("testLikeBlog", mApi.likeBlog("6323406", "silenttiger"));
}
/**
* 取消博文点赞
*/
@Test
public void testUnLikeBlog() {
runTest("testUnLikeBlog", mApi.unLikeBlog("6323406", "silenttiger"));
}
/**
* 知识库点赞
*/
@Test
public void testLikeKb() {
runTest("testLikeKb", mApi.likeKb("569992"));
}
/**
* 发表博客评论
*/
@Test
public void testAddCommentBlog() {
runTest("testAddCommentBlog", mApi.addBlogComment("6323406", "silenttiger", null, "test comment"));
}
/**
* 删除博客评论
*/
@Test
public void testDelCommentBlog() {
runTest("testDelCommentBlog", mApi.deleteBlogComment("6323406"));
}
}