コード例 #1
0
        public void MoveUpDown()
        {
            CommandHistory commandHistory = new CommandHistory();
            Model          modelToMove    = Apsim.Get(simulations, "APS14.Factors.Permutation.NRate") as Model;

            MoveModelUpDownCommand moveCommand = new MoveModelUpDownCommand(modelToMove, true, null);

            moveCommand.Do(commandHistory);

            Model modelToMove2 = Apsim.Get(simulations, "APS14.Factors.NRate") as Model;

            Assert.AreEqual(simulations.Children[2].Children[0].Children[0].Children[0].Name, "NRate");
            Assert.AreEqual(simulations.Children[2].Children[0].Children[0].Children[0].Children.Count, 4);
        }
コード例 #2
0
        public void MoveUpDown()
        {
            var            tree           = new MockTreeView();
            CommandHistory commandHistory = new CommandHistory(tree);
            Model          modelToMove    = simulations.FindByPath("APS14.Factors.Permutation.NRate")?.Value as Model;

            MoveModelUpDownCommand moveCommand = new MoveModelUpDownCommand(modelToMove, true);

            moveCommand.Do(tree, _ => {});

            Model modelToMove2 = simulations.FindByPath("APS14.Factors.NRate")?.Value as Model;

            Assert.AreEqual(simulations.Children[2].Children[0].Children[0].Children[0].Name, "NRate");
            Assert.AreEqual(simulations.Children[2].Children[0].Children[0].Children[0].Children.Count, 4);
        }
コード例 #3
0
        public void MoveUpDown()
        {
            IExplorerView     explorerView      = new ExplorerView();
            ExplorerPresenter explorerPresenter = new ExplorerPresenter();
            CommandHistory    commandHistory    = new CommandHistory();

            explorerPresenter.Attach(simulations, explorerView, null);

            Model modelToMove = Apsim.Get(simulations, "APS14.Factors.NRate") as Model;

            MoveModelUpDownCommand moveCommand = new MoveModelUpDownCommand(modelToMove, true, explorerView);

            moveCommand.Do(commandHistory);

            Model modelToMove2 = Apsim.Get(simulations, "APS14.Factors.NRate") as Model;

            Assert.AreEqual(simulations.Children[2].Children[0].Children[0].Name, "NRate");
            Assert.AreEqual(simulations.Children[2].Children[0].Children[0].Children.Count, 4);
        }