package Ġdynamic Programming Ċ Ċ import Ġorg . junit . Test Ċ Ċ class ĠZero One K nap s ack Problem Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Both Weight And Value Array Has Different Values G ives Expected Output () Ġ{ ĊĠĠĠĠĠĠĠ Ġassert ( zero One K nap s ack ( 5 , Ġint ArrayOf ( 3 , 2 , 1 ), Ġint ArrayOf ( 2 0 , 5 0 , 3 0 ), 3 ) Ġ== Ġ 8 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Both Weight And Value Array Has Same Values G ives Expected Output (){ ĊĠĠĠĠĠĠĠ Ġassert ( zero One K nap s ack ( 3 , Ġint ArrayOf ( 2 , 2 ), Ġint ArrayOf ( 3 , 3 ), 2 )== 3 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Negative Capacity G ives Zero (){ ĊĠĠĠĠĠĠĠ Ġassert ( zero One K nap s ack (- 3 , Ġint ArrayOf ( 2 , 2 ), Ġint ArrayOf ( 3 , 3 ), 2 )== 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Zero Capacity G ives Zero (){ ĊĠĠĠĠĠĠĠ Ġassert ( zero One K nap s ack ( 0 , Ġint ArrayOf ( 2 , 2 ), Ġint ArrayOf ( 3 , 3 ), 2 )== 0 ) ĊĠĠĠ Ġ} Ċ }