package Ġuk . n hs . n hs x . covid 1 9 . android . app . state Ċ Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġio . mock k . verify Ċ import Ġorg . junit . Test Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . data . Duration Days Ċ import Ġkotlin . test . assertEquals Ċ Ċ class ĠI sol ation Configuration Provider Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġm oshi Ġ= ĠM oshi . Builder (). build () ĊĊĠĠĠ Ġprivate Ġval Ġisolation Configuration Json Provider Ġ= ĊĠĠĠĠĠĠĠ Ġmock k < Isolation Configuration Json Provider >( relax ed Ġ= Ġtrue ) ĊĊĠĠĠ Ġprivate Ġval Ġtest Subject Ġ= ĠI sol ation Configuration Provider ( ĊĠĠĠĠĠĠĠ Ġisolation Configuration Json Provider , ĊĠĠĠĠĠĠĠ Ġm oshi ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` verify Ġserialization `() Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġisolation Configuration Json Provider . duration Json Ġ} Ġreturns Ġduration Days Json ĊĊĠĠĠĠĠĠĠ Ġval Ġparsed Duration Days Ġ= Ġtest Subject . duration Days ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( duration Days , Ġparsed Duration Days ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` verify Ġserialization Ġwithout Ġhouse keep ing Ġperiod `() Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġisolation Configuration Json Provider . duration Json Ġ} Ġreturns Ġduration Days Json Without House keep ing Period ĊĊĠĠĠĠĠĠĠ Ġval Ġparsed Duration Days Ġ= Ġtest Subject . duration Days ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( duration Days Default House keep ing Period , Ġparsed Duration Days ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` verify Ġde serialization `() Ġ{ ĊĊĠĠĠĠĠĠĠ Ġtest Subject . duration Days Ġ= Ġduration Days ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġisolation Configuration Json Provider . duration Json Ġ= Ġduration Days Json Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` on Ġexception Ġwill Ġreturn Ġdefault Ġvalues `() Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġisolation Configuration Json Provider . duration Json Ġ} Ġreturns Ġ""" wrong _ format """ ĊĊĠĠĠĠĠĠĠ Ġval Ġparsed Duration Days Ġ= Ġtest Subject . duration Days ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( Duration Days (), Ġparsed Duration Days ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġduration Days Ġ= ĠDuration Days ( ĊĠĠĠĠĠĠĠ Ġcontact Case Ġ= Ġ 3 2 , ĊĠĠĠĠĠĠĠ Ġindex Case Since Self Di agnosis On set Ġ= Ġ 7 , ĊĠĠĠĠĠĠĠ Ġindex Case Since Self Di agnosis Unknown On set Ġ= Ġ 5 , ĊĠĠĠĠĠĠĠ Ġmax Isolation Ġ= Ġ 2 1 , ĊĠĠĠĠĠĠĠ Ġpending Tasks Retention Period Ġ= Ġ 8 , ĊĠĠĠĠĠĠĠ Ġindex Case Since TestResult EndDate Ġ= Ġ 1 1 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġval Ġduration Days Json Ġ= ĊĠĠĠĠĠĠĠ Ġ""" {" contact Case ": 3 2 ," index Case Since Self Di agnosis On set ": 7 ," index Case Since Self Di agnosis Unknown On set ": 5 ," max Isolation ": 2 1 ," pending Tasks Retention Period ": 8 ," index Case Since TestResult EndDate ": 1 1 } """ ĊĊĠĠĠ Ġprivate Ġval Ġduration Days Default House keep ing Period Ġ= ĠDuration Days ( ĊĠĠĠĠĠĠĠ Ġcontact Case Ġ= Ġ 3 2 , ĊĠĠĠĠĠĠĠ Ġindex Case Since Self Di agnosis On set Ġ= Ġ 7 , ĊĠĠĠĠĠĠĠ Ġindex Case Since Self Di agnosis Unknown On set Ġ= Ġ 5 , ĊĠĠĠĠĠĠĠ Ġmax Isolation Ġ= Ġ 2 1 , ĊĠĠĠĠĠĠĠ Ġpending Tasks Retention Period Ġ= Ġ 1 4 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġval Ġduration Days Json Without House keep ing Period Ġ= ĊĠĠĠĠĠĠĠ Ġ""" {" contact Case ": 3 2 ," index Case Since Self Di agnosis On set ": 7 ," index Case Since Self Di agnosis Unknown On set ": 5 ," max Isolation ": 2 1 } """ Ċ } Ċ