Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Samba-build/Samba-code/src/main/java/io/avalia/samba/Banjo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.avalia.samba;

public class Banjo implements IInstrument {

public String play() {
return "dumdum";
}

public int getSoundVolume() {
return 500;
}

public String getColor() {
return "white";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.avalia.samba;

import org.junit.Assert;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;

public class BanjoTest {

@Test
public void thereShouldBeAnIInstrumentInterfaceAndABanjoClass() {
IInstrument banjo = new Banjo();
assertNotNull(banjo);
}

@Test
public void itShouldBePossibleToPlayAnInstrument() {
IInstrument banjo = new Banjo();
String sound = banjo.play();
assertNotNull(sound);
}

@Test
public void aBanjoShouldMakePouet() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it make "pouet" or "dumdum" ?

IInstrument banjo = new Banjo();
String sound = banjo.play();
Assert.assertEquals("dumdum", sound);
}

@Test
public void shouldHaveAMediumSoundVolume() {
IInstrument banjo = new Banjo();
int soundVolume = banjo.getSoundVolume();
Assert.assertEquals(500, soundVolume);
}

@Test
public void shouldHaveWhiteColor() {
IInstrument banjo = new Banjo();
String color = banjo.getColor();
Assert.assertEquals("white", color);
}


}