package Ġcom . jetbrains . edu . course creator . actions . placeholder Ċ Ċ import Ġcom . jetbrains . edu . course creator . CC Utils Ċ import Ġcom . jetbrains . edu . course creator . CC Utils . DEFAULT _ PLACE HOLDER _ TEXT Ċ import Ġcom . jetbrains . edu . learning . course Format . Answer Placeholder Dependency Ċ import Ġcom . jetbrains . edu . learning . test Action Ċ Ċ class ĠCC Add Answer Placeholder Action Test Ġ: ĠCC Add Answer Placeholder Action TestBase () Ġ{ ĊĊĠ Ġfun Ġ` test Ġadd Ġplaceholder Ġwithout Ġselection Ġwithout Ġdependency `() Ġ{ ĊĠĠĠ Ġval Ġcourse Ġ= Ġcourse With Files ( course Mode Ġ= ĠCC Utils . CO URSE _ MODE ) Ġ{ ĊĠĠĠĠĠ Ġlesson (" lesson 1 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġedu Task (" task 1 ") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġtask File (" Task . kt ", ĠDEFAULT _ TASK _ TEXT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġtask File Ġ= Ġcourse . lessons [ 0 ]. task List [ 0 ]. task Files [" Task . kt "] !! ĊĠĠĠ Ġval Ġtask File Expected Ġ= Ġcopy ( task File ) ĊĠĠĠ Ġtask File Expected . create Expected Placeholder ( 0 , ĠDEFAULT _ PLACE HOLDER _ TEXT , ĠDEFAULT _ PLACE HOLDER _ TEXT ) ĊĊĠĠĠ Ġdo Test (" lesson 1 / task 1 / Task . kt ", ĠC CT est Add Answer Placeholder (), Ġtask File , Ġtask File Expected ) ĊĠ Ġ} ĊĊĠ Ġfun Ġ` test Ġadd Ġplaceholder Ġwith Ġselection Ġwithout Ġdependency `() Ġ{ ĊĠĠĠ Ġval Ġcourse Ġ= Ġcourse With Files ( course Mode Ġ= ĠCC Utils . CO URSE _ MODE ) Ġ{ ĊĠĠĠĠĠ Ġlesson (" lesson 1 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġedu Task (" task 1 ") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġtask File (" Task . kt ", ĠDEFAULT _ TASK _ TEXT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġtask File Ġ= Ġcourse . lessons [ 0 ]. task List [ 0 ]. task Files [" Task . kt "] !! ĊĠĠĠ Ġval Ġtask File Expected Ġ= Ġcopy ( task File ) ĊĠĠĠ Ġval Ġselection Ġ= ĠSelection ( 1 0 , Ġ 1 9 ) ĊĠĠĠ Ġtask File Expected . create Expected Placeholder ( 1 0 , ĠDEFAULT _ PLACE HOLDER _ TEXT , ĠDEFAULT _ TASK _ TEXT . substring ( 1 0 , Ġ 1 9 )) ĊĊĠĠĠ Ġdo Test (" lesson 1 / task 1 / Task . kt ", ĠC CT est Add Answer Placeholder (), Ġtask File , Ġtask File Expected , Ġselection ) ĊĠ Ġ} ĊĊĠ Ġfun Ġ` test Ġplaceholder Ġintersection `() Ġ{ ĊĠĠĠ Ġcourse With Files ( course Mode Ġ= ĠCC Utils . CO URSE _ MODE ) Ġ{ ĊĠĠĠĠĠ Ġlesson (" lesson 1 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġedu Task (" task 1 ") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġtask File (" Task . kt ", ĠDEFAULT _ TASK _ TEXT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġmy Fixture . open File In Editor ( find File (" lesson 1 / task 1 / Task . kt ")) ĊĠĠĠ Ġtest Action ( C CT est Add Answer Placeholder ()) ĊĠĠĠ Ġmy Fixture . editor . selection Model . setSelection ( 0 , Ġ 6 ) ĊĠĠĠ Ġtest Action ( C CT est Add Answer Placeholder (), ĠshouldBe Enabled Ġ= Ġfalse , ĠshouldBe Visible Ġ= Ġtrue ) ĊĠ Ġ} ĊĊĠ Ġfun Ġ` test Ġadd Ġplaceholder Ġwith Ġdependency `() Ġ{ ĊĠĠĠ Ġval Ġcourse Ġ= Ġcourse With Files ( course Mode Ġ= ĠCC Utils . CO URSE _ MODE ) Ġ{ ĊĠĠĠĠĠ Ġlesson (" lesson 1 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġedu Task (" task 1 ") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġtask File (" Task . kt ", Ġ" fun Ġ< p > foo (): ĠString Ġ= ĠTODO ()</ p >") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġedu Task (" task 2 ") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġtask File (" Task . kt ", ĠDEFAULT _ TASK _ TEXT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġtask File Ġ= Ġcourse . lessons [ 0 ]. task List [ 1 ]. task Files [" Task . kt "] !! ĊĠĠĠ Ġval Ġtask File Expected Ġ= Ġcopy ( task File ) ĊĠĠĠ Ġval Ġplaceholder Expected Ġ= Ġtask File Expected . create Expected Placeholder ( 0 , ĠDEFAULT _ PLACE HOLDER _ TEXT , ĠDEFAULT _ PLACE HOLDER _ TEXT ) ĊĠĠĠ Ġval Ġplaceholder Dependency Ġ= ĠAnswer Placeholder Dependency ( placeholder Expected , Ġnull , Ġ" lesson 1 ", Ġ" task 1 ", Ġ" Task . kt ", Ġ 1 , Ġtrue ) ĊĠĠĠ Ġplaceholder Expected . placeholder Dependency Ġ= Ġplaceholder Dependency ĊĠĠĠ Ġdo Test (" lesson 1 / task 2 / Task . kt ", ĊĠĠĠĠĠĠĠĠĠĠ ĠC CT est Add Answer Placeholder ( CC Create Answer Placeholder Dialog . Dependency Info (" lesson 1 # task 1 # Task . kt # 1 ", Ġtrue )), Ġtask File , ĊĠĠĠĠĠĠĠĠĠĠ Ġtask File Expected ) ĊĠ Ġ} ĊĊĠ Ġfun Ġ` test Ġadd Ġplaceholder Ġaction Ġis Ġdisabled Ġin Ġnon Ġtemp lated Ġbased Ġframework Ġlesson `() Ġ{ ĊĠĠĠ Ġcourse With Files ( course Mode Ġ= ĠCC Utils . CO URSE _ MODE ) Ġ{ ĊĠĠĠĠĠ Ġframework Lesson (" lesson 1 ", Ġis Template Based Ġ= Ġfalse ) Ġ{ ĊĠĠĠĠĠĠĠ Ġedu Task (" task 1 ") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġtask File (" Task . kt ", Ġ" fun Ġfoo (): ĠString Ġ= ĠTODO () ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġfile Ġ= Ġfind File (" lesson 1 / task 1 / Task . kt ") ĊĠĠĠ Ġmy Fixture . open File In Editor ( file ) ĊĠĠĠ Ġtest Action ( C CT est Add Answer Placeholder (), ĠshouldBe Enabled Ġ= Ġfalse ) ĊĠ Ġ} Ċ } Ċ