rage / java-programming

https://java-programming.mooc.fi
521 stars 213 forks source link

Update 3-similarity-of-objects.md #436

Closed Luitenist closed 11 months ago

Luitenist commented 1 year ago

I have one failed test upon submitting my file:

FAIL:

VehicleRegistryTest getMethod
Seaching for a plate that has been added to the registry should return its owner
VehicleRegistry vr = new VehicleRegistry(); 

vr.add( new LicensePlate("FI", "AAA-111"), "Arto");
vr.add( new LicensePlate("FI", "XX-999"), "Arto");
vr.search( new LicensePlate("FI", "XX-999"));
expected:<Arto> but was:<null>

This shows that there a "search" method is expected which returns the owner of the supplied LicensePlate.