Seite 1 von 1

Ex 3 Hardware Interfaces

Verfasst: 7. Mai 2012 14:23
von xAx
Hi,

are we allowed to change all the hardware related interfaces as we wish? E.g. LaneController only declares the functions

Code: Alles auswählen

    public Object getFallenPins();

    public void clearLane();
I am missing functions to reflect requirements à la "rebuild all pins" or "Remove the fallen pins and rebuild all pins left over from the last throw".

Thanks for your help!

Re: Ex 3 Hardware Interfaces

Verfasst: 7. Mai 2012 15:31
von sproksch
Yeah, absolutely. These interface were provided to give you an impression what is asked for... You are free to change/extend/remove any of the code contained in the project.

Re: Ex 3 Hardware Interfaces

Verfasst: 8. Mai 2012 16:35
von C0RNi666
From a testing point of perspective, are we required to implement the interfaces as well?

Re: Ex 3 Hardware Interfaces

Verfasst: 8. Mai 2012 16:40
von sproksch
Mockito can create mocks of interfaces, so you do not necessarily need to implement the interfaces. Nevertheless it might be necessary to implement some stubs or spies to cover all possible indirect in-/outputs that are created/consumed by those objects...

Re: Ex 3 Hardware Interfaces

Verfasst: 8. Mai 2012 16:44
von sproksch
I have a small addition to give you an easier start on this: I think you might want to have a look at the Mockito.when(<call on mock>).thenReturn(<some object>) method. An example of this was provided in the tests of ex01 and ex02.

Re: Ex 3 Hardware Interfaces

Verfasst: 8. Mai 2012 16:52
von C0RNi666
Thanks, of course.. That helps! :)