Ejemplo n.º 1
0
            public void WhenDeletingTailorableProperty_ThenThrows()
            {
                var dte = VsIdeTestHostContext.Dte;

                dte.Solution.Open(PathTo("SampleToolkit\\Tailored\\SampleTailoring.gen.sln"));
                dte.ExecuteCommand("File.OpenFile", "PatternModel.gen.patterndefinition");

                var designer = new DslDesigner(VsIdeTestHostContext.ServiceProvider);

                var patternShape = PresentationViewsSubject.GetPresentation((designer.DocData.RootElement))
                    .OfType<ShapeElement>().First();

                var tailorableProperty = patternShape.FindLastChild(true).Shape.FindLastChild(true);

                designer.DocView.CurrentDiagram.ActiveDiagramView.Selection.FocusedItem = tailorableProperty;

                // TODO: couldn't get the command to execute. I'm getting a null ref at the bottom of the ocean.
                var commands = new Commands(VsIdeTestHostContext.ServiceProvider);

                commands.Execute(StandardCommands.Delete);
            }
Ejemplo n.º 2
0
            public void WhenDeletingTailorableProperty_ThenThrows()
            {
                var dte = VsIdeTestHostContext.Dte;

                dte.Solution.Open(PathTo("SampleToolkit\\Tailored\\SampleTailoring.gen.sln"));
                dte.ExecuteCommand("File.OpenFile", "PatternModel.gen.patterndefinition");

                var designer = new DslDesigner(VsIdeTestHostContext.ServiceProvider);

                var patternShape = PresentationViewsSubject.GetPresentation((designer.DocData.RootElement))
                                   .OfType <ShapeElement>().First();

                var tailorableProperty = patternShape.FindLastChild(true).Shape.FindLastChild(true);

                designer.DocView.CurrentDiagram.ActiveDiagramView.Selection.FocusedItem = tailorableProperty;

                // TODO: couldn't get the command to execute. I'm getting a null ref at the bottom of the ocean.
                var commands = new Commands(VsIdeTestHostContext.ServiceProvider);

                commands.Execute(StandardCommands.Delete);
            }