Example #1
0
        public void BeamActionReference()
        {
            var actionsGraph     = Setup.ActionGraph;
            var modifierRegister = new ModifierRegister();

            modifierRegister.Register(actionsGraph);

            Setup.Document.Transact();
            BuildPoint(Setup.Document, _point1);
            BuildPoint(Setup.Document, _point2);
            Setup.Document.Commit("Draw initial shapes");

            Setup.SwitchUserAction(ModifierNames.None);

            Assert.AreEqual(2, Setup.Document.Root.Children.Count, "The first two shapes aren't drawn");

            Setup.SwitchUserAction(Constant.ActionBeam);
            var container  = ((MetaActionContainer)Setup.ActionGraph.ModifierContainer[Constant.ActionBeam]);
            var dependency = container.Dependency;

            var firstPoint  = new SceneSelectedEntity(Setup.Document.Root.Children[0]);
            var secondPoint = new SceneSelectedEntity(Setup.Document.Root.Children[1]);

            dependency.ProposeCandidate(firstPoint);
            container.PushValue(firstPoint);

            dependency.ProposeCandidate(secondPoint);
            container.PushValue(secondPoint);

            Setup.SwitchUserAction(ModifierNames.None);

            Assert.AreEqual(3, Setup.Document.Root.Children.Count);
        }
        public void ConfigureTestEnvironment()
        {
            _setup = new SetupUtils();
            _setup.InitializeModifiersSetup();
            var actionsGraph     = _setup.ActionGraph;
            var modifierRegister = new ModifierRegister();

            modifierRegister.Register(actionsGraph);
            var functionFactory =
                actionsGraph[InputNames.FunctionFactoryInput].GetData(NotificationNames.GetValue).Get <IFunctionFactory>();

            _sut = functionFactory.Get(Constant.FunctionBeam.GetHashCode());
        }