예제 #1
0
        /// <summary>
        /// This function is the callback used to execute a command when the a menu item is clicked.
        /// See the Initialize method to see how the menu item is associated to this function using
        /// the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            // Show a Message Box to prove we were here
            IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
            //Guid clsid = Guid.Empty;
            //int result;
            //Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure( uiShell.ShowMessageBox(
            //                                                                           0,
            //                                                                           ref clsid,
            //                                                                           "UT",
            //                                                                           string.Format( CultureInfo.CurrentCulture,
            //                                                                                          "Inside {0}.MenuItemCallback()",
            //                                                                                          this.ToString() ),
            //                                                                           string.Empty,
            //                                                                           0,
            //                                                                           OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //                                                                           OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
            //                                                                           OLEMSGICON.OLEMSGICON_INFO,
            //                                                                           0,
            //                                                                           // false

            //                                                                           out result ) );

            IntPtr hwnd;

            uiShell.GetDialogOwnerHwnd(out hwnd);

            // Get an instance of the currently running Visual Studio IDE
            //DTE dte = (DTE) GetService( typeof( DTE ) );
            //if( !dte.Solution.IsOpen )
            //{
            //    return;
            //}

            //var assemblies = new List<string>();
            //foreach( Project project in dte.Solution.Projects )
            //{
            //    var name = project.Name;

            //    if( name.EndsWith( "Test.Unit" ) )
            //    {
            //        assemblies.Add( GetAssemblyPath( project ) );
            //    }
            //}

            const string solution     = "TouchUI";
            var          assemblyList = new List <string>
            {
                @"D:\TFS\IRIDIUM1\bin\Debug\CT.Exam.TouchUI.FE.Test.Unit.dll",
            };
            //var root = AssemblyWalker.BuildTree( dte.Solution.FileName, assemblies );
            var root = AssemblyWalker.BuildTree(solution, assemblyList);

            MainWindow mainWindow = new MainWindow();

            var projects = new UtTreeViewModel(root);

            mainWindow.DataContext = projects;
            WindowHelper.ShowModal(mainWindow, hwnd);
        }
예제 #2
0
        public LoadAssemblyTests()
        {
            var assembly       = typeof(Dummy).Assembly;
            var assemblyWalker = new AssemblyWalker("Dasher.Schema.Generation.*,Something", "Microsoft.*,Another");

            _assemblyWalkerProxy = new AssemblyWalkerProxy(assemblyWalker);
            _dasherAssemblyInfo  = assemblyWalker.GetDasherAssemblyInfo(assembly);
        }
예제 #3
0
        public void FilterReferencedAssembliesIncludedNotExistBothTest()
        {
            var aw     = new AssemblyWalker("NotExist*,NotExist", "ExcludedAssembly,Excluded.*");
            var proxy  = new AssemblyWalkerProxy(aw);
            var result = proxy.GetFilteredReferencedAssemblyNames(GetTestAssemblies());

            Assert.NotNull(result);
            Assert.Equal(0, result.Count());
        }
예제 #4
0
        public void FilterReferencedAssembliesOneIncludedTest()
        {
            var aw     = new AssemblyWalker("IncludedAssembly", "ExcludedAssembly,Excluded.*");
            var proxy  = new AssemblyWalkerProxy(aw);
            var result = proxy.GetFilteredReferencedAssemblyNames(GetTestAssemblies());

            Assert.NotNull(result);
            Assert.Equal(1, result.Count());
            Assert.Equal("IncludedAssembly", result[0].Name);
        }
예제 #5
0
        public void FilterReferencedAssembliesEmptyTest()
        {
            var aw     = new AssemblyWalker(null, null);
            var proxy  = new AssemblyWalkerProxy(aw);
            var result = proxy.GetFilteredReferencedAssemblyNames(GetTestAssemblies());

            Assert.NotNull(result);
            Assert.Equal(4, result.Count());
            Assert.Equal("Included.Assembly", result[0].Name);
            Assert.Equal("IncludedAssembly", result[1].Name);
        }
예제 #6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            var solution     = "UtProject";
            var assemblyList = new List <string>
            {
                @"C:\Users\sxu\source\repos\CalculatorDemo\CalculatorDemoTests\bin\Debug\CalculatorDemoTests.dll",
            };

            var        treeRoot = AssemblyWalker.BuildTree(solution, assemblyList);
            var        projects = new UtTreeViewModel(treeRoot);
            MainWindow window   = new MainWindow();

            window.DataContext = projects;
            window.ShowDialog();
        }
예제 #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var solution     = "TouchUI";
            var assemblyList = new List <string>
            {
                //@"D:\TFS\SSME.HMI\bin\Debug\CT.Exam.TouchUI.FE.Test.Unit.dll",
                @"C:\Users\sxu\source\repos\CalculatorDemo\CalculatorDemoTests\bin\Debug\CalculatorDemoTests.dll",
            };
            var treeRoot = AssemblyWalker.BuildTree(solution, assemblyList);

            var projects = new UtTreeViewModel(treeRoot);

            UTAssistant.FE.MainWindow mainWindow = new UTAssistant.FE.MainWindow();
            mainWindow.DataContext = projects;

            mainWindow.ShowDialog();
        }
예제 #8
0
 public AssemblyWalkerProxy(AssemblyWalker assemblyWalker)
 {
     _assemblyWalker = assemblyWalker;
     _type           = _assemblyWalker.GetType();
 }