package Ġcom . property listing . contracts Ċ Ċ import Ġcom . property listing . contracts . contract Tests Mock Data . Property Listing Contract Test Mock Data Ċ import Ġnet . cord a . core . identity . C ord a X 5 0 0 Name Ċ import Ġnet . cord a . testing . contracts . Dummy State Ċ import Ġnet . cord a . testing . core . Test Identity Ċ import Ġnet . cord a . testing . node . Mock Services Ċ import Ġnet . cord a . testing . node . ledger Ċ import Ġorg . junit . Test Ċ Ċ class ĠProperty Listing Contract Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġledger Services Ġ= ĠMock Services () ĊĠĠĠ Ġprivate Ġval Ġtest Owner Ġ= ĠTest Identity ( C ord a X 5 0 0 Name (" Test Owner ", Ġ" L ondon ", Ġ" GB ")) ĊĠĠĠ Ġprivate Ġval Ġtest Request er Ġ= ĠTest Identity ( C ord a X 5 0 0 Name (" Test Request er ", Ġ" New ĠYork ", Ġ" US ")) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` property Ġlist `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput State Ġ= ĠProperty Listing Contract Test Mock Data (). output State ( test Owner , test Request er ) ĊĠĠĠĠĠĠĠ Ġval Ġinvalid Output State Ġ= ĠProperty Listing Contract Test Mock Data (). invalid Output State ( test Owner ) ĊĠĠĠĠĠĠĠ Ġval Ġinvalid Property Address Output State Ġ= ĠProperty Listing Contract Test Mock Data (). invalid Property Address Output State ( test Owner , test Request er ) ĊĠĠĠĠĠĠĠ Ġval Ġinvalid Property Area Output State Ġ= ĠProperty Listing Contract Test Mock Data (). invalid Property Area Output State ( test Owner , test Request er ) ĊĠĠĠĠĠĠĠ Ġval Ġinvalid Property Sell ing Price Output State Ġ= ĠProperty Listing Contract Test Mock Data (). invalid Property Sell ing Price Output State ( test Owner , test Request er ) ĊĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( test Owner . publicKey , Ġtest Request er . publicKey ), ĠProperty Listing Contract . Commands . STORE PROPERTY ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , Ġoutput State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġverifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , ĠDummy State ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( test Owner . publicKey , Ġtest Request er . publicKey ), ĠProperty Listing Contract . Commands . STORE PROPERTY ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , Ġoutput State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis Ġ` fails Ġwith ` Ġ" No Ġinputs Ġshould Ġbe Ġconsumed Ġin Ġtransaction " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( test Owner . publicKey , ĠProperty Listing Contract . Commands . STORE PROPERTY ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , Ġinvalid Output State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis Ġ` fails Ġwith ` Ġ" The Ġtransaction Ġshould Ġhave Ġtwo Ġparticipants " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( test Request er . publicKey , ĠProperty Listing Contract . Commands . STORE PROPERTY ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , Ġoutput State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis Ġ` fails Ġwith ` Ġ" The Ġtransaction Ġmust Ġbe Ġsigned Ġby Ġboth Ġthe Ġparticipants " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( test Owner . publicKey , Ġtest Request er . publicKey ), ĠProperty Listing Contract . Commands . STORE PROPERTY ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , Ġinvalid Property Address Output State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis Ġ` fails Ġwith ` Ġ" Property ĠAddress Ġis Ġa Ġmandatory Ġfield " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( test Owner . publicKey , Ġtest Request er . publicKey ), ĠProperty Listing Contract . Commands . STORE PROPERTY ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , Ġinvalid Property Area Output State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis Ġ` fails Ġwith ` Ġ" Property ĠArea Ġshould Ġbe Ġgreater Ġthan Ġzero " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( test Owner . publicKey , Ġtest Request er . publicKey ), ĠProperty Listing Contract . Commands . STORE PROPERTY ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Property Listing Contract . PROPERTY _ CONTRACT _ ID , Ġinvalid Property Sell ing Price Output State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis Ġ` fails Ġwith ` Ġ" Property ĠS elling ĠPrice Ġshould Ġbe Ġgreater Ġthan Ġzero " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }