package Ġcom . sk ed go . android . common . model Ċ Ċ import Ġcom . google . gson . Gson Ċ import Ġcom . sk ed go . android . common . Base UnitTest Ċ import Ġcom . sk ed go . android . common . R Ċ import Ġorg . am sh ove . k lu ent . should EqualTo Ċ import Ġorg . assertj . core . api . Java 6 Assertions . assertThat Ċ import Ġorg . junit . Test Ċ import Ġsk ed go . tri pk it . routing . Service Color Ċ import Ġjava . util .* Ċ Ċ @ Suppress (" Illegal Identifier ") Ċ class ĠTransport Mode Test Ġ: ĠBase UnitTest () Ġ{ ĊĠ Ġ@ Test Ġfun Ġ` should Ġassociate Ġbi ke - share Ġicon Ġwith Ġid Ġstarting Ġwith Ġ" cy _ bic - s "` () Ġ{ ĊĠĠĠ Ġval Ġlocal Icon Res Id Ġ= ĠTransport Mode . getLocal Icon Res Id (" cy _ bic - s ") ĊĠĠĠ Ġlocal Icon Res Id . should EqualTo ( R . drawable . ic _ bic ycle _ share ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġserialized Names () Ġ{ ĊĠĠĠ Ġval Ġmode Ġ= ĠTransport Mode () ĊĠĠĠ Ġmode . id Ġ= Ġ" Some Ġid " ĊĠĠĠ Ġmode . set URL (" sk ed go . com ") ĊĠĠĠ Ġmode . title Ġ= Ġ" Some Ġtitle " ĊĠĠĠ Ġmode . icon Id Ġ= Ġ" Some Ġicon Ġid " ĊĠĠĠ Ġmode . set Dark Icon (" Some Ġdark Ġicon ") ĊĠĠĠ Ġmode . set Imp lies ( ArrayList ( Arrays . asList (" A ha ", Ġ" U hu ", Ġ" H uh ? "))) ĊĠĠĠ Ġmode . setColor ( Service Color ( 1 , Ġ 2 , Ġ 3 )) ĊĊĠĠĠ Ġval Ġjson Ġ= ĠGson (). toJson Tree ( mode ). as JsonObject ĊĠĠĠ ĠassertThat ( json ). isNotNull () ĊĠĠĠ ĠassertThat ( json . has (" id ")). isTrue () ĊĠĠĠ ĠassertThat ( json . has (" URL ")). isTrue () ĊĠĠĠ ĠassertThat ( json . has (" title ")). isTrue () ĊĠĠĠ ĠassertThat ( json . has (" implies ")). isTrue () ĊĠĠĠ ĠassertThat ( json . has (" required ")). isTrue () ĊĠĠĠ ĠassertThat ( json . has (" icon ")). isTrue () ĊĠĠĠ ĠassertThat ( json . has (" dark Icon ")). isTrue () ĊĠĠĠ ĠassertThat ( json . has (" color ")). isTrue () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun ĠshouldBe Equal () Ġ{ ĊĠĠĠ Ġval Ġmode 0 Ġ= ĠTransport Mode . from Id (" bus ") ĊĠĠĠ Ġval Ġmode 1 Ġ= ĠTransport Mode . from Id (" bus ") ĊĊĠĠĠ ĠassertThat ( mode 0 ). isEqualTo ( mode 1 ) ĊĠĠĠ ĠassertThat ( mode 1 ). isEqualTo ( mode 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġshould Not Be Equal () Ġ{ ĊĠĠĠ Ġval Ġbus Ġ= ĠTransport Mode . from Id (" bus ") ĊĠĠĠ Ġval Ġcar Ġ= ĠTransport Mode . from Id (" car ") ĊĊĠĠĠ ĠassertThat ( bus ). isNot EqualTo (" Awesome !") ĊĠĠĠ ĠassertThat ( bus ). isNot EqualTo ( car ) ĊĠĠĠ ĠassertThat ( car ). isNot EqualTo ( bus ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġnew From Id () Ġ{ ĊĠĠĠ Ġval Ġbus Ġ= ĠTransport Mode . from Id (" bus ") ĊĠĠĠ ĠassertThat ( bus . id ). isEqualTo (" bus ") ĊĠ Ġ} Ċ } Ċ