public void Notify(eDirection dir) { if (dir.Equals(eDirection.LEFT)) { if (selectedLevelIndex > 0) { selectedLevelIndex--; } } else if (dir.Equals(eDirection.RIGHT)) { if (selectedLevelIndex < bmsFileList.Count - 1) { selectedLevelIndex++; } } }
public void Notify(eDirection dir, Action prevAction = null, Action nextAction = null) { if (dir.Equals(eDirection.UP)) { if (SelectedMusicIndex > 0) { prevAction?.Invoke(); SelectedMusicIndex--; nextAction?.Invoke(); } } else if (dir.Equals(eDirection.DOWN)) { if (SelectedMusicIndex < musicInfoList.Count - 1) { prevAction?.Invoke(); SelectedMusicIndex++; nextAction?.Invoke(); } } }
public void ShouldReverseCanvas(eDirection direction) { //Given PaintingMediator paint = new PaintingMediator(); CanvasBackService canvasService = new CanvasBackService(); Canvas canvasNode = new Canvas(); canvasService.SetCanvas(canvasNode); paint.SetCanvasService(canvasService); //When paint.Reverse(direction); //Then ScaleTransform expectedTransform = new ScaleTransform(); if (direction.Equals(eDirection.Horizontal)) expectedTransform.ScaleY = -1; else if (direction.Equals(eDirection.Vertical)) expectedTransform.ScaleX = -1; Assert.AreEqual(expectedTransform.Value, canvasNode.RenderTransform.Value); }