package Ġk tx . vis Ċ Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . Actor Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . ui . Cell Ċ import Ġcom . badlogic . gdx . scenes . scene 2 d . ui . Horizontal Group Ċ import Ġcom . badlogic . gdx . utils . Array Ċ import Ġcom . kot cr ab . vis . ui . Vis UI Ċ import Ġcom . kot cr ab . vis . ui . util . adapter . Simple ListAdapter Ċ import Ġcom . kot cr ab . vis . ui . widget . spinner . Int Spinner Model Ċ import Ġorg . junit . Assert .* Ċ import Ġorg . junit . Ignore Ċ import Ġorg . junit . Test Ċ Ċ /** Ċ Ġ* Ġ@ param ĠF Ġtype Ġof Ġ[ Widget Factory ] Ġunder Ġtest Ċ Ġ* Ġ@ param ĠFR Ġreturn Ġtype Ġof Ġ[ Widget Factory ] Ġunder Ġtest Ċ Ġ* Ġ@ author ĠK ot cr ab Ċ Ġ*/ Ċ @ Ignore (" Base Ġclass Ġfor Ġothers Ġtests Ġshould Ġnot Ġbe Ġtested ") Ċ abstract Ġclass ĠWidget Factory Test < out ĠF Ġ: ĠWidget Factory < FR >, ĠFR > Ġ: ĠNeeds Lib G DX () Ġ{ ĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Label () Ġ= Ġtest Factory Method ({ Ġit . label (" label ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Link Label () Ġ= Ġtest Factory Method ({ Ġit . link Label (" label ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Image From Drawable () Ġ= Ġtest Factory Method ({ Ġit . image ( Vis UI . get Skin (). get Drawable (" white ")) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Image FromName () Ġ= Ġtest Factory Method ({ Ġit . image (" white ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create List () Ġ= Ġtest Factory Method ({ Ġit . list < String >() Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create ProgressBar () Ġ= Ġtest Factory Method ({ Ġit . progress Bar () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create ProgressBar From Style () Ġ= Ġtest Factory Method ({ Ġit . progress Bar ( style Name Ġ= Ġ" default - vertical ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Select Box () Ġ= Ġtest Factory Method ({ Ġit . select Box < String >() Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Slider () Ġ= Ġtest Factory Method ({ Ġit . slider () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Slider From Style () Ġ= Ġtest Factory Method ({ Ġit . slider ( style Name Ġ= Ġ" default - vertical ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create TextArea () Ġ= Ġtest Factory Method ({ Ġit . textArea () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Highlight TextArea () Ġ= Ġtest Factory Method ({ Ġit . highlight TextArea () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Scroll able TextArea () Ġ= Ġtest Factory Method ({ Ġit . scroll able TextArea () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create TextField () Ġ= Ġtest Factory Method ({ Ġit . textField () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Valid atable TextField () Ġ= Ġtest Factory Method ({ Ġit . valid atable TextField (" text field ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Touch pad () Ġ= Ġtest Factory Method ({ Ġit . touch pad ( 1 f ) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Busy Bar () Ġ= Ġtest Factory Method ({ Ġit . busy Bar () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Separator () Ġ= Ġtest Factory Method ({ Ġit . separator () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Button () Ġ= Ġtest Factory Method ({ Ġit . button () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Text Button () Ġ= Ġtest Factory Method ({ Ġit . text Button (" text button ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Image Button From Style Name () Ġ= Ġtest Factory Method ({ Ġit . image Button (" default ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Image Button From Drawable () Ġ= Ġtest Factory Method ({ Ġit . image Button ( Vis UI . get Skin (). get Drawable (" white ")) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Image Text Button () Ġ= Ġtest Factory Method ({ Ġit . image Text Button (" ima get ext button ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create CheckBox () Ġ= Ġtest Factory Method ({ Ġit . checkBox (" checkbox ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create RadioButton () Ġ= Ġtest Factory Method ({ Ġit . radioButton (" radio button ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Tree () Ġ= Ġtest Factory Method ({ Ġit . tree () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Spinner () Ġ= Ġtest Factory Method ({ Ġit . spinner (" spinner ", ĠInt Spinner Model ( 0 , Ġ 0 , Ġ 1 0 0 )) Ġ}) ĊĊĠ Ġ@ Test Ġ@ Ignore (" Unable Ġto Ġcompile Ġshader Ġin Ġtest Ġenvironment ") ĊĠ Ġfun Ġshould Create Basic Color Picker () Ġ= Ġtest Factory Method ({ Ġit . basic Color Picker () Ġ}) ĊĊĠ Ġ@ Test Ġ@ Ignore (" Unable Ġto Ġcompile Ġshader Ġin Ġtest Ġenvironment ") ĊĠ Ġfun Ġshould Create Extended Color Picker () Ġ= Ġtest Factory Method ({ Ġit . extended Color Picker () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould CreateTable () Ġ= Ġtest Factory Method ({ Ġit . table Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Button Table () Ġ= Ġtest Factory Method ({ Ġit . button Table Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Horizontal Group () Ġ= Ġtest Factory Method ({ Ġit . horizontal Group Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Horizontal Flow Group () Ġ= Ġtest Factory Method ({ Ġit . horizontal Flow Group Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Vertical Group () Ġ= Ġtest Factory Method ({ Ġit . vertical Group Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Vertical Flow Group () Ġ= Ġtest Factory Method ({ Ġit . vertical Flow Group Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Grid Group () Ġ= Ġtest Factory Method ({ Ġit . grid Group Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Floating Group () Ġ= Ġtest Factory Method ({ Ġit . floating Group Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Floating Group From Pref Size () Ġ= Ġtest Factory Method ({ Ġit . floating Group ( 1 f , Ġ 1 f ) Ġ{} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Drag Pane () Ġ= Ġtest Factory Method ({ Ġit . drag Pane ( Horizontal Group (), Ġ{}) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Stack () Ġ= Ġtest Factory Method ({ Ġit . stack Ġ{ Ġ} Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create ScrollPane () Ġ= Ġtest Factory Method ({ Ġit . scroll Pane ( table Ġ{ Ġ}) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Split Pane () Ġ= Ġtest Factory Method ({ Ġit . split Pane ( table Ġ{ Ġ}, Ġtable Ġ{ Ġ}) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Split Pane From Style () Ġ= Ġtest Factory Method ({ Ġit . split Pane ( table Ġ{ Ġ}, Ġtable Ġ{ Ġ}, Ġstyle Name Ġ= Ġ" default - vertical ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Multi Split Pane () Ġ= Ġtest Factory Method ({ Ġit . multi Split Pane () Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Multi Split Pane From Style () Ġ= Ġtest Factory Method ({ Ġit . multi Split Pane ( style Name Ġ= Ġ" default - vertical ") Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Container () Ġ= Ġtest Factory Method ({ Ġit . container ( table Ġ{ Ġ}) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Col lapsible () Ġ= Ġtest Factory Method ({ Ġit . collapsible ( table Ġ{ Ġ}) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Horizontal Col lapsible () Ġ= Ġtest Factory Method ({ Ġit . horizontal Col lapsible ( table Ġ{ Ġ}) Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Tabbed Pane () Ġ= Ġtest Factory Method ({ Ġit . tab bed Pane Ġ{ Ġ}. table Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create ListView () Ġ= Ġtest Factory Method ({ Ġit . list View ( Simple ListAdapter ( Array < String >() )). main Table Ġ}) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshould Create Actor () Ġ= Ġtest Factory Method ({ Ġit . actor ( Actor (), Ġ{}) Ġ}) ĊĊĠ Ġabstract Ġfun Ġtest Factory Method ( factory Method UnderTest : Ġ( F ) Ġ-> ĠActor ) Ċ } Ċ Ċ class ĠTable Widget Factory Test Ġ: ĠWidget Factory Test < Table Widget Factory , ĠCell <* >>() Ġ{ ĊĠ Ġoverride Ġfun Ġtest Factory Method ( factory Method UnderTest : Ġ( Table Widget Factory ) Ġ-> ĠActor ) Ġ{ ĊĠĠĠ Ġvar Ġinit Inv oked Ġ= Ġfalse ĊĠĠĠ Ġtable Ġ{ ĊĠĠĠĠĠ Ġinit Inv oked Ġ= Ġtrue ĊĠĠĠĠĠ Ġval Ġchildren Before Widget Added Ġ= Ġchildren . size ĊĠĠĠĠĠ Ġval Ġwidget Ġ= Ġfactory Method UnderTest ( this ) ĊĠĠĠĠĠ ĠassertNotNull ( widget ) ĊĠĠĠĠĠ ĠassertEquals ( children Before Widget Added Ġ+ Ġ 1 , Ġchildren . size ) ĊĠĠĠĠĠ ĠassertTrue ( children . last () Ġ== Ġwidget ) ĊĠĠĠ Ġ} ĊĠĠĠ ĠassertTrue ( init Inv oked ) ĊĠ Ġ} Ċ } Ċ Ċ class ĠWidget Group Widget Factory Test Ġ: ĠWidget Factory Test < Widget Factory < Actor >, ĠActor >() Ġ{ ĊĠ Ġoverride Ġfun Ġtest Factory Method ( factory Method UnderTest : Ġ( Widget Factory < Actor >) Ġ-> ĠActor ) Ġ{ ĊĠĠĠ Ġvar Ġinit Inv oked Ġ= Ġfalse ĊĠĠĠ Ġhorizontal Group Ġ{ ĊĠĠĠĠĠ Ġinit Inv oked Ġ= Ġtrue ĊĠĠĠĠĠ Ġval Ġchildren Before Widget Added Ġ= Ġchildren . size ĊĠĠĠĠĠ Ġval Ġwidget Ġ= Ġfactory Method UnderTest ( this ) ĊĠĠĠĠĠ ĠassertNotNull ( widget ) ĊĠĠĠĠĠ ĠassertEquals ( children Before Widget Added Ġ+ Ġ 1 , Ġchildren . size ) ĊĠĠĠĠĠ ĠassertTrue ( children . last () Ġ== Ġwidget ) ĊĠĠĠ Ġ} ĊĠĠĠ ĠassertTrue ( init Inv oked ) ĊĠ Ġ} Ċ } Ċ