import Ġitem stuff .* Ċ import Ġcontainer . Container Ċ Ċ fun Ġhas Room Test () Ġ{ ĊĠĠĠ Ġval Ġitems Ġ= ĠBase Item Container ( false , ĠINVALID _ ITEM , ĠItem ( 1 , Ġ 1 ), ĠItem ( 2 , Ġ 5 ), ĠINVALID _ ITEM , ĠItem ( 3 , Ġ 1 )) ĊĠĠĠ Ġprintln (" Has Ġroom Ġtests ") ĊĠĠĠ Ġhas Room Not Always Stack able ( items ) ĊĠĠĠ Ġhas Room Always Stack able ( items ) Ċ } Ċ Ċ fun Ġhas Room Not Always Stack able ( items : ĠContainer < Base Item >) Ġ{ ĊĠĠĠ Ġval Ġtest Name Ġ= Ġ" Has ĠRoom Ġ( not Ġalways Ġstack able )" ĊĠĠĠ Ġval Ġcontainer Ġ= Ġitems . copy ( always Stack able Ġ= Ġfalse ) ĊĠĠĠ Ġwith ( container ) Ġ{ ĊĠĠĠĠĠĠĠ Ġassert (! has Room For ( Item ( 1 , Ġ 3 ))) Ġ{ Ġexpected Got ( test Name , Ġfalse , Ġtrue ) Ġ} ĊĠĠĠĠĠĠĠ Ġadd Item ( Item ( 1 , Ġ 2 )) ĊĠĠĠĠĠĠĠ Ġassert ( has Room For ( Item ( 2 , Ġ 1 0 0 ))) Ġ{ Ġexpected Got ( test Name , Ġtrue , Ġfalse ) Ġ} ĊĠĠĠĠĠĠĠ Ġadd Item ( Item ( 2 , Ġ 1 0 0 )) ĊĠĠĠĠĠĠĠ Ġassert (! has Room For ( Item ( 3 ))) Ġ{ Ġexpected Got ( test Name , Ġfalse , Ġtrue ) Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġprintln ("\ t $ test Name Ġpassed ") Ċ } Ċ Ċ fun Ġhas Room Always Stack able ( items : ĠContainer < Base Item >) Ġ{ ĊĠĠĠ Ġval Ġtest Name Ġ= Ġ" Has ĠRoom Ġ( always Ġstack able )" ĊĠĠĠ Ġval Ġcontainer Ġ= Ġitems . copy ( always Stack able Ġ= Ġtrue ) ĊĠĠĠ Ġwith ( container ) Ġ{ ĊĠĠĠĠĠĠĠ Ġassert ( has Room For ( Item ( 1 , Ġ 5 0 0 ))) Ġ{ Ġexpected Got ( test Name , Ġtrue , Ġfalse ) Ġ} ĊĠĠĠĠĠĠĠ Ġadd Item ( Item ( 1 , Ġ 5 0 0 )) ĊĠĠĠĠĠĠĠ Ġassert ( has Room For ( Item ( 4 , Ġ 2 ))) Ġ{ Ġexpected Got ( test Name , Ġtrue , Ġfalse ) Ġ} ĊĠĠĠĠĠĠĠ Ġadd Item ( Item ( 4 , Ġ 2 )) ĊĠĠĠ Ġ} ĊĠĠĠ Ġprintln ("\ t $ test Name Ġpassed ") Ċ }