public void Ctor_ShouldProjectConfiguraitonThrowArgumentNullException()
 {
     //Assert
     Assert.Throws <ArgumentNullException>(() =>
     {
         //Act
         OpenFromPackageViewModel viewModel = new OpenFromPackageViewModel(this.dialogFactory, this.templateLoader, this.messageManager, "C#", null);
     });
 }
 public void Ctor_ShouldTemplateLoaderThrowArgumentNullException()
 {
     //Assert
     Assert.Throws <ArgumentNullException>(() =>
     {
         //Act
         OpenFromPackageViewModel viewModel = new OpenFromPackageViewModel(this.dialogFactory, null, "C#", this.projectConfiguration);
     });
 }
        public void SetUp()
        {
            this.dialogFactory = Substitute.For <IDialogFactory>();
            templateLoader     = new TemplateLoader(this.dialogFactory);

            this.projectConfiguration = Substitute.For <IProjectConfiguraiton>();
            this.projectConfiguration.LastSelectedSearchTypeInOpenFromPackage.Returns("MethodContent");
            openFromPackageViewModel = new OpenFromPackageViewModel(this.dialogFactory, templateLoader, "C#", this.projectConfiguration);
        }
Beispiel #4
0
        public IViewAdaper <OpenFromPackageView, OpenFromPackageViewResult> GetOpenFromPackageView(TemplateLoader templateLoader, string projectLanguage, IProjectConfiguraiton projectConfiguration)
        {
            var viewModel = new OpenFromPackageViewModel(this, templateLoader, projectLanguage, projectConfiguration);
            var view      = new OpenFromPackageView();

            view.DataContext = viewModel;

            AttachToParentWindow(view);
            return(new OpenFromPackageViewAdapter(view));
        }
        public IViewAdaper <OpenFromPackageView, OpenFromPackageViewResult> GetOpenFromPackageView(IVsUIShell uiShell, TemplateLoader templateLoader, string projectLanguage, IProjectConfiguraiton projectConfiguration)
        {
            var viewModel = new OpenFromPackageViewModel(templateLoader, projectLanguage, projectConfiguration);
            var view      = new OpenFromPackageView();

            view.DataContext = viewModel;

            IntPtr hwnd;

            uiShell.GetDialogOwnerHwnd(out hwnd);
            var windowInteropHelper = new WindowInteropHelper(view);

            windowInteropHelper.Owner = hwnd;

            return(new OpenFromPackageViewAdapter(view));
        }