public void LoadPlaylistShouldUseSongservicesToPopulateList() { //arrange Mock <IPlaylistDao> mock; var sqliteService = CreateServiceWith2MockSubServices(out mock); var service1 = new Mock <ISongServicePlaylistSaver>(); var service2 = new Mock <ISongServicePlaylistSaver>(); var stubSong1 = new TestSong(); var stubSong2 = new TestSong(); service1.Setup(t => t.LoadSongsBelongingToPlaylist(It.IsAny <int>())) .Returns(new List <BaseSong>() { stubSong1 }); sqliteService.Services.Add(service1.Object); service2.Setup(t => t.LoadSongsBelongingToPlaylist(It.IsAny <int>())) .Returns(new List <BaseSong>() { stubSong2 }); sqliteService.Services.Add(service2.Object); mock.Setup(t => t.GetPlaylistIdFromName(It.IsAny <string>())).Returns("1"); //act var loadedPlaylist = sqliteService.LoadPlaylist(""); //assert Assert.IsTrue(loadedPlaylist.Songs.Contains(stubSong1)); Assert.IsTrue(loadedPlaylist.Songs.Contains(stubSong2)); }
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| // _CORE PROCESSES_ // START // Use this for initialization void Start() { Application.targetFrameRate = 60; //currentSong = Overseer.selectedSong; currentSong = TestSong.getTestSong(); Overseer.songScore = 0; Debug.Log(currentSong.SongName); Debug.Log(currentSong.LoopList[0].SongName); currentLoop = currentSong.LoopList[0]; loopRepetition = 1; timer = new TimingManager(currentLoop.BeatsPerMinute); graphics = GameObject.FindObjectOfType <GraphicsManager>(); levels = GameObject.FindObjectOfType <LevelManager>(); inputManager = GameObject.FindObjectOfType <InputManager>(); sounds = GameObject.FindObjectOfType <SoundManager>(); score = FindObjectOfType <ScoreController>(); beatNo = timer.currentBeat(); // Find the first edge. currentEdge = currentLoop.EdgeList[0]; currentNode = currentEdge.FromNode; endNode = currentLoop.NodeList[currentLoop.NodeList.Count - 1]; if (currentNode.StartNode) { startNode = currentNode; //Debug.Log("All loaded, we're good to go! - " + ((double)(Time.time - TimingManager.StartTime)).ToString()); //Debug.Log(currentNode.NodeName + " " + CurrentNode.NodeType.ToString()); } playerEdge = currentEdge; playerNode = currentNode; graphics.beginGraphicsProcess(); loaded = true; }
private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { Song s = new Song(); s.Name = "test"; s.Number = 1; Name2 = s.Name; TestSong.Add(s); }
public void QueueController_IsPlayingEvent_SongChanged() { Mock <IQueueController> mock; var vm = CreateVM(out mock); var stub = new TestSong(); mock.Raise(t => t.CurrentSongChangedEvent += null, new SongChangedEventArgs(stub)); Assert.AreSame(stub, vm.CurrenSong); }
static void TestLyricsSource() { //ILyricsSource strategy = new LyricsSourceLyricWiki(); //ILyricsSource strategy = new LyricsSourceLyricWikiHtml(); //ILyricsSource strategy = new LyricsSourceLyrdb(); //ILyricsSource strategy = new LyricsSourceLyricsPlugin(); ILyricsSource strategy = new LyricsSourceLyricsFly(); //TestSong song = new TestSong("Lips don't hie", "Shakira", "Music of the Sun", ""); //TestSong song = new TestSong("Hips don't lie", "Shakira", "Music of the Sun", ""); //TestSong song = new TestSong("Pon de replay", "Rihanna", "Music of the Sun", ""); //TestSong song = new TestSong("I Love to Move in Here", "Moby", "Last Night", ""); TestSong song = new TestSong("Year 3000", "Busted", "", ""); Console.WriteLine(song); Console.WriteLine(strategy.GetLyrics(song)); }
public void CurrentSong_set_NewRaiseEvent() { var eventRaised = false; BaseSong songSent = null; IQueueController controller = new QueueController(); controller.CurrentSongChangedEvent += delegate(object s, SongChangedEventArgs model) { eventRaised = true; songSent = model.CurrentSong; }; var songStub = new TestSong(); controller.CurrentSong = songStub; Assert.IsTrue(eventRaised); Assert.AreSame(songSent, songStub); }
private void Start() { chosenSong = GetSongByName(globalSongInfo.SongName); PlaySong(chosenSong.Song); }