import org.junit.Test; import static org.junit.Assert.assertEquals; /** * * * @author Ben McCurdy and Matthew Garcia * @version GUitar Tuning Choice Points for CS56, S11 * */ public class GuitarTuningTest { /** set up a default guitar tuning to test the default constructor. Print it out to see if the inputed values are correct */ @Test public void testConstructor() { GuitarTuning s = new GuitarTuning(); assertEquals("Tuning: 64 59 55 50 45 40",s.toString()); } /** set up a Guitar tuning in dropD and then test the constructor that has arguments. Print it out to see if the correct values were inputed */ @Test public void testConstructorWithArgs() { int [] dropDStrings = {64, 59, 55, 50, 45, 38}; GuitarTuning dropD = new GuitarTuning ( dropDStrings ); assertEquals("Tuning: 64 59 55 50 45 38",dropD.toString()); } /** set up a Guitar tuning with the default constructor and then check the first element. */ @Test public void testMidiNumWithDefaultConstructor() { GuitarTuning woot = new GuitarTuning(); assertEquals(64, woot.midiNum(1,0)); } /** set up a Tuning dropD with the constructor, then see if the values are what we expect them to be. */ @Test public void testMidiNumWithDropD() { int [] dropDStrings = {64, 59, 55, 50, 45, 36}; GuitarTuning dropD = new GuitarTuning ( dropDStrings ); assertEquals(70,dropD.midiNum(3,15)); } }