package Ġcom . dg . watcher . watch ing . survey ing Ċ Ċ import Ġcom . dg . watcher . watch ing . saving . Size Entry Ċ import Ġcom . dg . watcher . watch ing . survey ing . Size Survey ing Result . SIZE _ THRESHOLD _ EX CE EDED Ċ import Ġcom . dg . watcher . watch ing . survey ing . Size Survey ing Result . SIZE _ THRESHOLD _ MET Ċ import Ġorg . hamcrest . Matchers .` is ` Ċ import Ġorg . hamcrest . Matchers . equalTo Ċ import Ġorg . junit . Assert . assertThat Ċ import Ġorg . junit . Test ĊĊ Ċ class ĠSize Survey ing Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġpass Ġthe Ġsize Ġsurvey Ġwhen Ġthere Ġare Ġno Ġsizes Ġrecorded `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠG IV EN ĊĠĠĠĠĠĠĠ Ġval Ġsizes Ġ= ĠlistOf < Size Entry >() ĊĊĠĠĠĠĠĠĠ Ġ// ĠTHEN ĊĠĠĠĠĠĠĠ ĠassertThat ( survey Sizes ( sizes , Ġthreshold In Mb Ġ= Ġ 1 f ), Ġ` is `( equalTo ( SIZE _ THRESHOLD _ MET ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġpass Ġthe Ġsize Ġsurvey Ġwhen Ġonly Ġone Ġsize Ġis Ġrecorded `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠG IV EN ĊĠĠĠĠĠĠĠ Ġval Ġsizes Ġ= ĠlistOf ( Size Entry ("# 1 ", Ġsize In Byte Ġ= Ġ 1 0 0 0 0 0 0 0 L )) ĊĊĠĠĠĠĠĠĠ Ġ// ĠTHEN ĊĠĠĠĠĠĠĠ ĠassertThat ( survey Sizes ( sizes , Ġthreshold In Mb Ġ= Ġ 1 f ), Ġ` is `( equalTo ( SIZE _ THRESHOLD _ MET ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġpass Ġthe Ġsize Ġsurvey Ġwhen Ġthe Ġsize Ġdifference Ġis Ġbelow Ġthe Ġthreshold `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠG IV EN ĊĠĠĠĠĠĠĠ Ġval Ġsizes Ġ= ĠlistOf ( Size Entry ("# 1 ", Ġsize In Byte Ġ= Ġ 1 0 0 0 0 0 0 0 L ), ĠSize Entry ("# 2 ", Ġsize In Byte Ġ= Ġ 1 1 0 0 0 0 0 0 L )) ĊĊĠĠĠĠĠĠĠ Ġ// ĠTHEN ĊĠĠĠĠĠĠĠ ĠassertThat ( survey Sizes ( sizes , Ġthreshold In Mb Ġ= Ġ 2 f ), Ġ` is `( equalTo ( SIZE _ THRESHOLD _ MET ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġpass Ġthe Ġsize Ġsurvey Ġwhen Ġthe Ġsize Ġdifference Ġis Ġexactly Ġthe Ġthreshold `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠG IV EN ĊĠĠĠĠĠĠĠ Ġval Ġsizes Ġ= ĠlistOf ( Size Entry ("# 1 ", Ġsize In Byte Ġ= Ġ 1 0 0 0 0 0 0 0 L ), ĠSize Entry ("# 2 ", Ġsize In Byte Ġ= Ġ 1 2 0 0 0 0 0 0 L )) ĊĊĠĠĠĠĠĠĠ Ġ// ĠTHEN ĊĠĠĠĠĠĠĠ ĠassertThat ( survey Sizes ( sizes , Ġthreshold In Mb Ġ= Ġ 2 f ), Ġ` is `( equalTo ( SIZE _ THRESHOLD _ MET ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġfail Ġthe Ġsize Ġsurvey Ġwhen Ġthe Ġsize Ġdifference Ġexceeds Ġthe Ġthreshold `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠG IV EN ĊĠĠĠĠĠĠĠ Ġval Ġsizes Ġ= ĠlistOf ( Size Entry ("# 1 ", Ġsize In Byte Ġ= Ġ 1 0 0 0 0 0 0 0 L ), ĠSize Entry ("# 2 ", Ġsize In Byte Ġ= Ġ 1 4 0 0 0 0 0 0 L )) ĊĊĠĠĠĠĠĠĠ Ġ// ĠTHEN ĊĠĠĠĠĠĠĠ ĠassertThat ( survey Sizes ( sizes , Ġthreshold In Mb Ġ= Ġ 2 f ), Ġ` is `( equalTo ( SIZE _ THRESHOLD _ EX CE EDED ))) ĊĠĠĠ Ġ} Ċ }