Ejemplo n.º 1
0
        public void SceneTransaction_RemoveManager()
        {
            var transaction = new SceneTransaction(new Scene("Test Scene"));
            transaction.ManagerToAdd = transaction.AvailableManagers.First();
            transaction.AddManager(transaction.ManagerToAdd);
            transaction.SelectedManager = transaction.SelectedManagers.First();
            int available = transaction.AvailableManagers.Count;

            CommandHelper.TestCommand(
                () => transaction.RemoveManagerCommand.Execute(null),
                () =>
                {
                    Assert.AreEqual(available + 1, transaction.AvailableManagers.Count);
                    Assert.AreEqual(0, transaction.SelectedManagers.Count);
                }
            );
        }
Ejemplo n.º 2
0
        public void SceneTransaction_Commit()
        {
            var scene = new Scene("TestScene");
            var transaction = new SceneTransaction(scene);
            transaction.Name = "TestScene2";
            transaction.AddManager(transaction.AvailableManagers.First());

            CommandHelper.TestUndoableCommand(
                () =>
                {
                    Assert.AreEqual("TestScene", scene.Name);
                    Assert.AreEqual(0, scene.Managers.Count);
                },
                () => transaction.CommitCommand.Execute(null),
                () =>
                {
                    Assert.AreEqual("TestScene2", scene.Name);
                    Assert.AreEqual(1, scene.Managers.Count);
                }
            );
        }