commit 7c09f96deecce5cc3ea0fb175634c42419f46ea3
parent 68b782deed8295eaed1ba3ef0365653fd8ad58ff
Author: gstraube <gstraube@mailbox.org>
Date: Mon, 24 Jul 2017 18:35:44 +0200
Account for random order of samples
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/src/test/java/com/github/cythara/SamplerTest.java b/app/src/test/java/com/github/cythara/SamplerTest.java
@@ -7,6 +7,7 @@ import java.util.List;
import static com.github.cythara.Note.*;
import static com.github.cythara.Sampler.*;
+import static org.hamcrest.CoreMatchers.either;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.closeTo;
import static org.junit.Assert.*;
@@ -67,7 +68,7 @@ public class SamplerTest {
}
@Test
- public void if_there_are_notes_with_the_same_number_of_occurrences_the_first_one_is_returned() {
+ public void if_there_are_notes_with_the_same_number_of_occurrences_one_of_them_is_returned() {
List<PitchDifference> samples = new ArrayList<>();
samples.add(new PitchDifference(G3, 2D));
@@ -78,6 +79,6 @@ public class SamplerTest {
Note note = extractMostFrequentNote(samples);
- assertThat(note, is(E2));
+ assertThat(note, either(is(E2)).or(is(B3)));
}
}
\ No newline at end of file