-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
130 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package docomo | ||
|
||
import ( | ||
"testing" | ||
"reflect" | ||
) | ||
|
||
func TestTrendGetGenre(t *testing.T) { | ||
type TestCase struct { | ||
in string | ||
out TrendGenreResponse | ||
} | ||
|
||
testCase := TestCase{ | ||
in: "../tests/stubs/trend_genre.json", | ||
} | ||
serve, client := Stub(testCase.in, &testCase.out) | ||
defer serve.Close() | ||
|
||
req := TrendGenreRequest{} | ||
res, err := client.Trend.GetGenre(req) | ||
if err != nil { | ||
t.Errorf("error Request %s\n", err) | ||
} | ||
|
||
if !reflect.DeepEqual(*res, testCase.out) { | ||
t.Errorf("error Response %s != %s\n", res, testCase.out) | ||
} | ||
} | ||
|
||
func TestTrendGetContents(t *testing.T) { | ||
type TestCase struct { | ||
in string | ||
out TrendContentsResponse | ||
} | ||
|
||
testCase := TestCase{ | ||
in: "../tests/stubs/trend_contents.json", | ||
} | ||
serve, client := Stub(testCase.in, &testCase.out) | ||
defer serve.Close() | ||
|
||
req := TrendContentsRequest{} | ||
var genreID int = 1 | ||
req.GenreID = &genreID | ||
res, err := client.Trend.GetContents(req) | ||
if err != nil { | ||
t.Errorf("error Request %s\n", err) | ||
} | ||
|
||
if !reflect.DeepEqual(*res, testCase.out) { | ||
t.Errorf("error Response %s != %s\n", res, testCase.out) | ||
} | ||
} | ||
|
||
func TestTrendGetSearch(t *testing.T) { | ||
type TestCase struct { | ||
in string | ||
out TrendSearchResponse | ||
} | ||
|
||
testCase := TestCase{ | ||
in: "../tests/stubs/trend_search.json", | ||
} | ||
serve, client := Stub(testCase.in, &testCase.out) | ||
defer serve.Close() | ||
|
||
req := TrendSearchRequest{} | ||
var keyword string = "test" | ||
req.Keyword = &keyword | ||
res, err := client.Trend.GetSearch(req) | ||
if err != nil { | ||
t.Errorf("error Request %s\n", err) | ||
} | ||
|
||
if !reflect.DeepEqual(*res, testCase.out) { | ||
t.Errorf("error Response %s != %s\n", res, testCase.out) | ||
} | ||
} | ||
|
||
func TestTrendGetRelated(t *testing.T) { | ||
type TestCase struct { | ||
in string | ||
out TrendRelatedResponse | ||
} | ||
|
||
testCase := TestCase{ | ||
in: "../tests/stubs/trend_related.json", | ||
} | ||
serve, client := Stub(testCase.in, &testCase.out) | ||
defer serve.Close() | ||
|
||
req := TrendRelatedRequest{} | ||
var contentID int = 1 | ||
req.ContentID = &contentID | ||
res, err := client.Trend.GetRelated(req) | ||
if err != nil { | ||
t.Errorf("error Request %s\n", err) | ||
} | ||
|
||
if !reflect.DeepEqual(*res, testCase.out) { | ||
t.Errorf("error Response %s != %s\n", res, testCase.out) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"totalResults":7,"startIndex":1,"itemsPerPage":7,"issueDate":"2015-01-10T16:05:19+0900","articleContents":[{"contentId":332209,"contentType":10,"genreId":5,"contentData":{"title":"【イベントレポート】Qualcomm、450MbpsのLTEや7GbpsのWiGigをデモ 〜Quick Charge 2.0対応機器も拡大中 ","body":"Qualcommは、International CESで同社のソリューションを多数展示した。基調講演に関しては別記事でお伝えした通り、昨年(2014年)発表済みのSnapdragon 810が実際の…","imageUrl":"http://pc.watch.impress.co.jp/img/pcw/docs/683/318/01.jpg","imageSize":{"height":531,"width":800},"createdDate":"2015-01-10T11:24:00+0900","sourceDomain":"pc.watch.impress.co.jp","sourceName":"PC Watch","linkUrl":"http://pc.watch.impress.co.jp/docs/news/event/20150110_683318.html"}},{"contentId":330011,"contentType":10,"genreId":5,"contentData":{"title":"ついにボタン型コンピュータ「Curie」が登場——2015年のIntelは何を目指すのか (1/3)","body":"ウェアラブルや3DインタフェースにかけるIntelの情熱は本物かもしれない——というのが2015年を迎えての最初の感想だ。 米Intelのブライアン・クルザニッチCEOは1月6日(米国時間)、米ネ…","createdDate":"2015-01-08T18:30:00+0900","sourceDomain":"www.itmedia.co.jp","sourceName":"ITmedia","linkUrl":"http://www.itmedia.co.jp/pcuser/articles/1501/08/news137.html"}},{"contentId":330483,"contentType":10,"genreId":1,"contentData":{"title":"ホンダに過去最高の7000万ドル制裁金、事故報告漏れ-米当局","body":"(ブルームバーグ):ホンダ は車両の不具合の可能性に関連した保証請求や1700件超の死傷事故で米当局への報告漏れがあったとして7000万ドル(約84億円)の制裁金支払いに合意し、監督強化にも同意した…","imageUrl":"http://www.bloomberg.co.jp/apps/data?pid=avimage&iid=iIPJYdITJiIM","imageSize":{"height":427,"width":640},"createdDate":"2015-01-09T04:04:00+0900","sourceDomain":"www.bloomberg.co.jp","sourceName":"ブルームバーグ","linkUrl":"http://www.bloomberg.co.jp/news/123-NHVDZT6VDKHV01.html"}},{"contentId":331074,"contentType":10,"genreId":5,"contentData":{"title":"BCN、恒例の年間販売数ランキング「BCN AWARD 2015」を発表 ","body":"株式会社BCNは9日、全国のPOSデータを元にした2014年の販売数ランキング「BCN AWARD 2015」を発表した。 今年はハードウェア85部門、ソフトウェア33部門の計118部門でランキン…","createdDate":"2015-01-09T14:23:00+0900","sourceDomain":"pc.watch.impress.co.jp","sourceName":"PC Watch","linkUrl":"http://pc.watch.impress.co.jp/docs/news/20150109_683181.html"}},{"contentId":328639,"contentType":10,"genreId":13,"contentData":{"title":"Razer,SensicsなどがVRのオープンソースプラットフォームを提言。VR HMD「OSVR Hacker Dev Kit」も199.99ドルで発売予定","body":"2015年1月6日,Razerと関連企業は,現在,米ラスベガスで開催されている「2015 CES」にて仮想現実(Virtual Realiry,以下VR)対応ゲームのためのオープンソースプラットフォ…","imageUrl":"http://www.4gamer.net/games/999/G999902/20150107082/TN/001.jpg","imageSize":{"height":193,"width":254},"createdDate":"2015-01-07T21:49:00+0900","sourceDomain":"www.4gamer.net","sourceName":"4Gamer.net","linkUrl":"http://www.4gamer.net/games/999/G999902/20150107082/"}},{"contentId":328512,"contentType":10,"genreId":13,"contentData":{"title":"Gamer Razer、VR技術のプログラミングを可能にするオープンソースソフトウェア&デバイス「OSVR Hacker Dev Kit」を発表","body":"Razerは、バーチャルリアリティのプログラミングに関するオープンソースソフトウェアおよびデバイスである、「オープンソース・バーチャルリアリティ・エコシステム(OSVR)」を発表した。","imageUrl":"http://image.gamer.ne.jp/news/2015/20150107/00468f9c7d4d45a41e166c0c052a3d2856c1/m/1.jpg","imageSize":{"height":215,"width":298},"createdDate":"2015-01-07T19:05:00+0900","sourceDomain":"www.gamer.ne.jp","sourceName":"Gamer","linkUrl":"http://www.gamer.ne.jp/news/201501070046/"}},{"contentId":326305,"contentType":10,"genreId":5,"contentData":{"title":"【イベントレポート】NVIDIAが発表したTegra X1ってどんなSoC? ","body":"別記事でも紹介しているように、NVIDIAは開発コードネームErista(アリスタ)で知られる、次世代Tegraを「Tegra X1」として発表し、今年の前半に出荷開始する予定であることを明らかにし…","imageUrl":"http://pc.watch.impress.co.jp/img/pcw/docs/682/499/01.jpg","imageSize":{"height":496,"width":800},"createdDate":"2015-01-06T06:00:00+0900","sourceDomain":"pc.watch.impress.co.jp","sourceName":"PC Watch","linkUrl":"http://pc.watch.impress.co.jp/docs/news/event/20150106_682499.html"}}]}cat | ||
{"totalResults":7,"startIndex":1,"itemsPerPage":7,"issueDate":"2015-01-10T16:05:19+0900","articleContents":[{"contentId":332209,"contentType":10,"genreId":5,"contentData":{"title":"【イベントレポート】Qualcomm、450MbpsのLTEや7GbpsのWiGigをデモ 〜Quick Charge 2.0対応機器も拡大中 ","body":"Qualcommは、International CESで同社のソリューションを多数展示した。基調講演に関しては別記事でお伝えした通り、昨年(2014年)発表済みのSnapdragon 810が実際の…","imageUrl":"http://pc.watch.impress.co.jp/img/pcw/docs/683/318/01.jpg","imageSize":{"height":531,"width":800},"createdDate":"2015-01-10T11:24:00+0900","sourceDomain":"pc.watch.impress.co.jp","sourceName":"PC Watch","linkUrl":"http://pc.watch.impress.co.jp/docs/news/event/20150110_683318.html"}},{"contentId":330011,"contentType":10,"genreId":5,"contentData":{"title":"ついにボタン型コンピュータ「Curie」が登場——2015年のIntelは何を目指すのか (1/3)","body":"ウェアラブルや3DインタフェースにかけるIntelの情熱は本物かもしれない——というのが2015年を迎えての最初の感想だ。 米Intelのブライアン・クルザニッチCEOは1月6日(米国時間)、米ネ…","createdDate":"2015-01-08T18:30:00+0900","sourceDomain":"www.itmedia.co.jp","sourceName":"ITmedia","linkUrl":"http://www.itmedia.co.jp/pcuser/articles/1501/08/news137.html"}},{"contentId":330483,"contentType":10,"genreId":1,"contentData":{"title":"ホンダに過去最高の7000万ドル制裁金、事故報告漏れ-米当局","body":"(ブルームバーグ):ホンダ は車両の不具合の可能性に関連した保証請求や1700件超の死傷事故で米当局への報告漏れがあったとして7000万ドル(約84億円)の制裁金支払いに合意し、監督強化にも同意した…","imageUrl":"http://www.bloomberg.co.jp/apps/data?pid=avimage&iid=iIPJYdITJiIM","imageSize":{"height":427,"width":640},"createdDate":"2015-01-09T04:04:00+0900","sourceDomain":"www.bloomberg.co.jp","sourceName":"ブルームバーグ","linkUrl":"http://www.bloomberg.co.jp/news/123-NHVDZT6VDKHV01.html"}},{"contentId":331074,"contentType":10,"genreId":5,"contentData":{"title":"BCN、恒例の年間販売数ランキング「BCN AWARD 2015」を発表 ","body":"株式会社BCNは9日、全国のPOSデータを元にした2014年の販売数ランキング「BCN AWARD 2015」を発表した。 今年はハードウェア85部門、ソフトウェア33部門の計118部門でランキン…","createdDate":"2015-01-09T14:23:00+0900","sourceDomain":"pc.watch.impress.co.jp","sourceName":"PC Watch","linkUrl":"http://pc.watch.impress.co.jp/docs/news/20150109_683181.html"}},{"contentId":328639,"contentType":10,"genreId":13,"contentData":{"title":"Razer,SensicsなどがVRのオープンソースプラットフォームを提言。VR HMD「OSVR Hacker Dev Kit」も199.99ドルで発売予定","body":"2015年1月6日,Razerと関連企業は,現在,米ラスベガスで開催されている「2015 CES」にて仮想現実(Virtual Realiry,以下VR)対応ゲームのためのオープンソースプラットフォ…","imageUrl":"http://www.4gamer.net/games/999/G999902/20150107082/TN/001.jpg","imageSize":{"height":193,"width":254},"createdDate":"2015-01-07T21:49:00+0900","sourceDomain":"www.4gamer.net","sourceName":"4Gamer.net","linkUrl":"http://www.4gamer.net/games/999/G999902/20150107082/"}},{"contentId":328512,"contentType":10,"genreId":13,"contentData":{"title":"Gamer Razer、VR技術のプログラミングを可能にするオープンソースソフトウェア&デバイス「OSVR Hacker Dev Kit」を発表","body":"Razerは、バーチャルリアリティのプログラミングに関するオープンソースソフトウェアおよびデバイスである、「オープンソース・バーチャルリアリティ・エコシステム(OSVR)」を発表した。","imageUrl":"http://image.gamer.ne.jp/news/2015/20150107/00468f9c7d4d45a41e166c0c052a3d2856c1/m/1.jpg","imageSize":{"height":215,"width":298},"createdDate":"2015-01-07T19:05:00+0900","sourceDomain":"www.gamer.ne.jp","sourceName":"Gamer","linkUrl":"http://www.gamer.ne.jp/news/201501070046/"}},{"contentId":326305,"contentType":10,"genreId":5,"contentData":{"title":"【イベントレポート】NVIDIAが発表したTegra X1ってどんなSoC? ","body":"別記事でも紹介しているように、NVIDIAは開発コードネームErista(アリスタ)で知られる、次世代Tegraを「Tegra X1」として発表し、今年の前半に出荷開始する予定であることを明らかにし…","imageUrl":"http://pc.watch.impress.co.jp/img/pcw/docs/682/499/01.jpg","imageSize":{"height":496,"width":800},"createdDate":"2015-01-06T06:00:00+0900","sourceDomain":"pc.watch.impress.co.jp","sourceName":"PC Watch","linkUrl":"http://pc.watch.impress.co.jp/docs/news/event/20150106_682499.html"}}]} |