/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 9 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . android . tools . idea . startup Ċ Ċ import Ġcom . android . tools . idea . Ide Info Ċ import Ġcom . android . tools . idea . testing . Android Project Rule Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . intellij . application . options . Code Style Ċ import Ġcom . intellij . lang . xml . XML Language Ċ import Ġcom . intellij . psi . code Style . Code Style Settings Ċ import Ġcom . intellij . psi . code Style . Common Code Style Settings . RE AR RANGE _ ALWAYS Ċ import Ġcom . intellij . psi . code Style . Java Code Style Settings Ċ import Ġorg . jetbrains . android . formatter . Android Xml Code Style Settings Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . runners . JUnit 4 Ċ Ċ @ RunWith ( JUnit 4 :: class ) Ċ class ĠAndroid Code Style Settings Test Ġ{ ĊĠ Ġ@ Rule ĊĠ Ġ@ Jvm Field ĊĠ Ġval Ġmy Rule Ġ= ĠAndroid Project Rule . in Memory () ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġinitialized Defaults In Real Project In Studio () Ġ{ ĊĠĠĠ Ġ// ĠNote : Ġthis Ġtest Ġis Ġintention ally Ġnot Ġan ĠAndroid TestCase , Ġbecause Ġthat Ġapplies Ġthe ĠAndroid Ġcode Ġstyle Ġto Ġall Ġtests Ġanyway . ĊĠĠĠ Ġif Ġ( Ide Info . getInstance (). is Android Studio ) Ġ{ ĊĠĠĠĠĠ Ġval Ġnew Settings Ġ= ĠCode Style . create Test Settings () ĊĠĠĠĠĠ ĠassertThat ( Android Xml Code Style Settings . getInstance ( new Settings ). USE _ CUSTOM _ SETTINGS ). isTrue () ĊĠĠĠĠĠ ĠassertThat ( new Settings . get Custom Settings ( Java Code Style Settings :: class . java ). CLASS _ COUNT _ TO _ USE _ IMPORT _ ON _ DE M AND ) ĊĠĠĠĠĠĠĠ Ġ. isEqualTo ( 9 9 ) ĊĠĠĠĠĠ ĠassertThat ( new Settings . get Common Settings ( XML Language . INSTANCE ). FORCE _ RE AR RANGE _ MODE ). isEqualTo ( RE AR RANGE _ ALWAYS ) ĊĊĠĠĠĠĠ Ġ// ĠCode Insight TestFixture Impl Ġwill Ġinstantiate Ġa Ġtemporary Ġcode Ġstyle Ġfor Ġeach Ġtest . ĠThis Ġtest Ġonly Ġneeds Ġto Ġverify Ġthe Ġcode Ġstyle ĊĠĠĠĠĠ Ġ// Ġdefaults Ġfor Ġthe Ġproject , Ġso Ġwe Ġcan Ġdrop Ġthe Ġtemporary Ġsettings Ġearly Ġas Ġwe 're Ġnot Ġgoing Ġto Ġmake Ġany Ġchanges . ĊĠĠĠĠĠ ĠCode Style . drop Temporary Settings ( my Rule . project ) ĊĠĠĠĠĠ Ġval Ġproject Settings Ġ= ĠCode Style . get Settings ( my Rule . project ) ĊĠĠĠĠĠ ĠassertThat ( Android Xml Code Style Settings . getInstance ( project Settings ). USE _ CUSTOM _ SETTINGS ). isTrue () ĊĠĠĠĠĠ ĠassertThat ( Java Code Style Settings . getInstance ( my Rule . project ). CLASS _ COUNT _ TO _ USE _ IMPORT _ ON _ DE M AND ). isEqualTo ( 9 9 ) ĊĠĠĠĠĠ ĠassertThat ( project Settings . get Common Settings ( XML Language . INSTANCE ). FORCE _ RE AR RANGE _ MODE ). isEqualTo ( RE AR RANGE _ ALWAYS ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ