ghazalghorabi / TDA553-lab1

0 stars 0 forks source link

CRITICAL: Test is failing #32

Closed martinjonsson01 closed 1 year ago

martinjonsson01 commented 1 year ago

One of your tests is failing, because there is a bug in your implementation of CarTransporter.

java.lang.NullPointerException: Cannot read field "minAngle" because "this.platform" is null
 at CarTransporter.closePlatform(CarTransporter.java:31)
 at TruckTest.lowerPlatformTransporter(TruckTest.java:55)

https://github.com/ghazalghorabi/TDA553-lab1/blob/01f3360df2ab6d8a3dae4522fac81312009bb5d9/test/TruckTest.java#L55

martinjonsson01 commented 1 year ago

You've now got several tests failing: image

This is very common when refactoring, like you've now done.

Don't see this as a bad thing! If you had not written these tests, then you wouldn't even know that something was broken, and you would've found out when the cars were travelling down the road 😝

This is why we write unit tests, to be able to rest assured that our code still works after we've reworked parts of it.

hannapanna3 commented 1 year ago

This issue is now resolved, do you want a new tag for this?

martinjonsson01 commented 1 year ago

Yes, please! :)

hannapanna3 commented 1 year ago

It should be under tag lab2c. :)

martinjonsson01 commented 1 year ago

Great job!