public void 無効な入力でCurrentItemがnullになる不具合の修正() { var window = new EPuzzleWindow(); var testState = new Fish.eigotest.TestState(window); Assert.Null(testState.CurrentItem); var b0 = new EigoTestButtonItem() { Left = 100, Top = 100, Width = 10, Height = 10, }; testState.Items.Add(b0); window.State = testState; Assert.AreSame(b0, testState.CurrentItem); testState.OnMoveLeft(); Assert.AreSame(b0, testState.CurrentItem); testState.OnMoveRight(); Assert.AreSame(b0, testState.CurrentItem); testState.OnMoveUp(); Assert.AreSame(b0, testState.CurrentItem); testState.OnMoveDown(); Assert.AreSame(b0, testState.CurrentItem); }
public void MoveDownTest() { var window = new EPuzzleWindow(); var testState1 = new Fish.eigotest.TestState(window); Assert.Null(testState1.CurrentItem); var button = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 100, Top = 100, Width = 10, Height = 10, }; testState1.Items.Add(button); window.State = testState1; Assert.AreSame(button, testState1.CurrentItem); var button2 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 110, Top = 100, Width = 10, Height = 10, }; testState1.Items.Add(button2); var button3 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 100, Top = 200, Width = 10, Height = 10, }; testState1.Items.Add(button3); testState1.OnMoveDown(); Assert.AreSame(button3, testState1.CurrentItem); var button4 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 110, Top = 200, Width = 10, Height = 10, }; testState1.Items.Add(button4); testState1.OnMoveUp(); Assert.AreSame(button, testState1.CurrentItem); var button5 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 100, Top = 110, Width = 10, Height = 10, }; testState1.Items.Add(button5); var button6 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 50, Top = 100, Width = 10, Height = 10, }; testState1.Items.Add(button6); testState1.OnMoveLeft(); Assert.AreSame(button6, testState1.CurrentItem); var button7 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 50, Top = 110, Width = 10, Height = 10, }; testState1.Items.Add(button7); testState1.OnMoveRight(); Assert.AreSame(button, testState1.CurrentItem); }
public void カーソル移動は同一軸優先() { var window = new EPuzzleWindow(); var testState = new Fish.eigotest.TestState(window); Assert.Null(testState.CurrentItem); var b0 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 100, Top = 100, Width = 10, Height = 10, }; testState.Items.Add(b0); window.State = testState; Assert.AreSame(b0, testState.CurrentItem); var b1 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 200, Top = 100, Width = 10, Height = 10, }; testState.Items.Add(b1); var b2 = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 100, Top = 200, Width = 10, Height = 10, }; testState.Items.Add(b2); { var b = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 120, Top = 120, Width = 10, Height = 10, }; testState.Items.Add(b); } { var b = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 180, Top = 120, Width = 10, Height = 10, }; testState.Items.Add(b); } { var b = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 120, Top = 180, Width = 10, Height = 10, }; testState.Items.Add(b); } Assert.AreSame(b0, testState.CurrentItem); testState.OnMoveRight(); Assert.AreSame(b1, testState.CurrentItem); testState.OnMoveLeft(); Assert.AreSame(b0, testState.CurrentItem); testState.OnMoveDown(); Assert.AreSame(b2, testState.CurrentItem); testState.OnMoveUp(); Assert.AreSame(b0, testState.CurrentItem); }