public void SupportsUnnamedPlmStreams() { model.WriteMultiByteValue(0x100, 2, new ModelDelta(), 0x0202); // move two at level 1 model.WriteMultiByteValue(0x102, 2, new ModelDelta(), 0x1404); // move four at level 10 (8+2, shifted once -> 14) model.WriteMultiByteValue(0x104, 2, new ModelDelta(), 0xFFFF); // end stream viewPort.Edit("<000100>"); // setup something to point at 000100, so we can have an unnamed stream there SetupMoveTable(0x20); viewPort.Goto.Execute("000100"); errors.Clear(); viewPort.Edit("^`plm`"); Assert.Empty(errors); var run = model.GetNextRun(0x100); Assert.IsType <PLMRun>(run); Assert.Equal(6, run.Length); var format = (PlmItem)viewPort[1, 0].Format; Assert.Equal(1, format.Level); Assert.Equal(2, format.Move); Assert.Equal("Two", format.MoveName); viewPort.SelectionStart = new Point(1, 0); Assert.True(viewPort.IsSelected(new Point(0, 0))); }
public void SelectionDoneInPairs() { CreateSimpleRun(); viewPort.SelectionStart = new Point(2, 0); // should select "Wind" Assert.True(viewPort.IsSelected(new Point(3, 0))); viewPort.MoveSelectionStart.Execute(Direction.Right); // should select "[]" Assert.True(viewPort.IsSelected(new Point(4, 0))); Assert.True(viewPort.IsSelected(new Point(5, 0))); }
public void BackSelectionWorks() { var loadedFile = new LoadedFile("test", new byte[25]); var viewPort = new ViewPort(loadedFile) { Width = 5, Height = 5 }; viewPort.SelectionStart = new Point(3, 3); viewPort.SelectionEnd = new Point(2, 1); Assert.True(viewPort.IsSelected(new Point(4, 2))); }