public void TestBeatRandomizer() { var settings = GetRandomizerSettings(RandomizerTestUtil.config9Panel); var randomizer = new BeatRandomizer(settings); var notes = GenerateNotes(4); var randomizedNotes = randomizer.RandomizeBeat(notes); }
public void CannotGenerateMoreNotesThanAvailableInPanelConfig() { var settings = GetRandomizerSettings(RandomizerTestUtil.config1Panel); var randomizer = new BeatRandomizer(settings); var notes = GenerateNotes(2); var randomizedNotes = randomizer.RandomizeBeat(notes); Assert.IsTrue(randomizedNotes.Count <= 1); }
public void CannotGenerateMoreThan2Notes() { var settings = GetRandomizerSettings(RandomizerTestUtil.config9Panel); var randomizer = new BeatRandomizer(settings); var notes = GenerateNotes(3); var randomizedNotes = randomizer.RandomizeBeat(notes); Assert.IsTrue(randomizedNotes.Count <= 2); }
private static List <PanelNote> PressNote(BeatRandomizer randomizer, int beat) { var notes = new List <Note>() { new Note(NoteType.Regular, beat) }; return(randomizer.RandomizeBeat(notes)); }
private List <PanelNote> HoldNote(BeatRandomizer randomizer, int beat, int duration) { var notes = new List <Note>() { new Note(NoteType.Hold, beat, duration) }; return(randomizer.RandomizeBeat(notes)); }
public void CannotGenerateDuplicateNotes() { var settings = GetRandomizerSettings(RandomizerTestUtil.config9Panel); var randomizer = new BeatRandomizer(settings); var notes = GenerateNotes(4); var randomizedNotes = randomizer.RandomizeBeat(notes); var distinctNotes = randomizedNotes.Select(x => x.panel).Distinct(); Assert.AreEqual(randomizedNotes.Count, distinctNotes.Count()); }
protected int[] RandomizeNote(BeatRandomizer randomizer) { var notes = new List <Note>() { new Note(NoteType.Regular, 0) }; var randomizedNote = randomizer.RandomizeBeat(notes).Single(); return(PanelConfigUtil.GetPanelIndices(randomizedNote.panel)); }