package Ġcom . da im ler . mb c ark it . business . model . vehicle Ċ Ċ import Ġcom . da im ler . mb c ark it . business . model . vehicle . unit . Clock Hour Unit Ċ import Ġcom . da im ler . mb c ark it . business . model . vehicle . unit . Display Unit Case Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Test Ċ import Ġjava . util . Date Ċ Ċ class ĠVehicle Status Test Ġ{ ĊĊĠĠĠ Ġvar Ġmy unit Ġ= ĠVehicle Attribute . Unit ("", ĠDisplay Unit Case . CLOCK _ HOUR _ UNIT , ĠClock Hour Unit . UNSPECIFIED _ CLOCK _ HOUR _ UNIT ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest If Battery State Is Mapped Correct ly _ From 0 To Green () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvehicle Attribute Ġ= ĠVehicle Attribute ( Status Enum . VALID , ĠDate (), Ġ 0 , Ġmy unit ) ĊĠĠĠĠĠĠĠ Ġval Ġbattery State Ġ= ĠVehicle Status . battery State From Int ( vehicle Attribute ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( Battery State . GREEN , Ġbattery State . value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest If Battery State Is Mapped Correct ly _ From 1 To YELLOW () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvehicle Attribute Ġ= ĠVehicle Attribute ( Status Enum . VALID , ĠDate (), Ġ 1 , Ġmy unit ) ĊĠĠĠĠĠĠĠ Ġval Ġbattery State Ġ= ĠVehicle Status . battery State From Int ( vehicle Attribute ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( Battery State . YELLOW , Ġbattery State . value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest If Battery State Is Mapped Correct ly _ From 2 To RED () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvehicle Attribute Ġ= ĠVehicle Attribute ( Status Enum . VALID , ĠDate (), Ġ 2 , Ġmy unit ) ĊĠĠĠĠĠĠĠ Ġval Ġbattery State Ġ= ĠVehicle Status . battery State From Int ( vehicle Attribute ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( Battery State . RED , Ġbattery State . value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest If Battery State Is Mapped Correct ly _ From 3 to Service Disabled () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvehicle Attribute Ġ= ĠVehicle Attribute ( Status Enum . VALID , ĠDate (), Ġ 3 , Ġmy unit ) ĊĠĠĠĠĠĠĠ Ġval Ġbattery State Ġ= ĠVehicle Status . battery State From Int ( vehicle Attribute ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( Battery State . SERVICE _ DISABLED , Ġbattery State . value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest If Key Activation State Is Mapped Correct ly _ From 1 To Active () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvehicle Attribute Ġ= ĠVehicle Attribute ( Status Enum . VALID , ĠDate (), Ġ 1 , Ġmy unit ) ĊĠĠĠĠĠĠĠ Ġval Ġk as Ġ= ĠVehicle Status . key Activation State From Int ( vehicle Attribute ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( Key Activation State . ALL _ KEYS _ ACTIVE , Ġk as . value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest If Key Activation State Is Mapped Correct ly _ From 0 To Inactive () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvehicle Attribute Ġ= ĠVehicle Attribute ( Status Enum . VALID , ĠDate (), Ġ 0 , Ġmy unit ) ĊĠĠĠĠĠĠĠ Ġval Ġk as Ġ= ĠVehicle Status . key Activation State From Int ( vehicle Attribute ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( Key Activation State . ALL _ KEYS _ IN ACTIVE , Ġk as . value ) ĊĠĠĠ Ġ} Ċ } Ċ