Ejemplo n.º 1
0
        public void Setup()
        {
            RxApp.MainThreadScheduler = Scheduler.CurrentThread;

            this.dialogNavigationService      = new Mock <IDialogNavigationService>();
            this.thingDialogNavigationService = new Mock <IThingDialogNavigationService>();
            this.filterStringService          = new Mock <IFilterStringService>();

            this.describeMetaData = new Mock <INameMetaData>();
            this.describeMetaData.Setup(x => x.Name).Returns("MockedPanelDecorated");

            this.panelView       = new Test(true);
            this.panelViewModel  = new TestViewModel();
            this.panelViewModel2 = new TestViewModel("data source");

            this.viewList = new List <IPanelView>();
            this.viewList.Add(this.panelView);
            this.viewList.Add(new TestGrid());

            this.viewModelDecoratedList = new List <Lazy <IPanelViewModel, INameMetaData> >();
            this.viewModelDecoratedList.Add(new Lazy <IPanelViewModel, INameMetaData>(() => this.panelViewModel2, this.describeMetaData.Object));

            this.viewModelList = new List <IPanelViewModel>();
            this.viewModelList.Add(this.panelViewModel);
            this.viewModelList.Add(new TestGridViewModel());

            this.dockLayoutViewModel = new DockLayoutViewModel(dialogNavigationService.Object);

            this.NavigationService = new PanelNavigationService(this.viewList, this.viewModelList, this.viewModelDecoratedList, this.dockLayoutViewModel, this.filterStringService.Object);

            this.session           = new Mock <ISession>();
            this.permissionService = new Mock <IPermissionService>();
            this.session.Setup(x => x.PermissionService).Returns(this.permissionService.Object);
        }
Ejemplo n.º 2
0
        public void VerifyThatNavigationServiceDoesNotThrowWhenPropertyGridNotFound()
        {
            this.NavigationService = new PanelNavigationService(new List <Lazy <IPanelView, IRegionMetaData> >(), new List <IPanelViewModel>(),
                                                                regionManager.Object, new List <Lazy <IPanelViewModel, INameMetaData> >());

            Assert.DoesNotThrow(() => this.NavigationService.Open(new Person(Guid.NewGuid(), null, null), this.session.Object));
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            RxApp.MainThreadScheduler = Scheduler.CurrentThread;

            this.dialogNavigationService      = new Mock <IDialogNavigationService>();
            this.thingDialogNavigationService = new Mock <IThingDialogNavigationService>();
            this.filterStringService          = new Mock <IFilterStringService>();

            this.regionManager   = new Mock <IRegionManager>();
            this.region          = new Mock <IRegion>();
            this.metadata        = new Mock <IRegionMetaData>();
            this.viewsCollection = new Mock <IViewsCollection>();

            this.describeMetaData = new Mock <INameMetaData>();
            this.describeMetaData.Setup(x => x.Name).Returns("MockedPanelDecorated");

            this.regionCollectionSearcher = new Mock <IRegionCollectionSearcher>();
            this.regionCollectionSearcher.Setup(x => x.GetRegionsByView(It.IsAny <IRegionCollection>(), It.IsAny <IPanelView>())).Returns(new [] { this.region.Object });
            this.regionManager.Setup(x => x.Regions[It.IsAny <string>()]).Returns(this.region.Object);
            this.region.Setup(x => x.Views).Returns(this.viewsCollection.Object);

            this.panelView       = new Test(true);
            this.panelViewModel  = new TestViewModel();
            this.panelViewModel2 = new TestViewModel("data source");

            this.viewList = new List <Lazy <IPanelView, IRegionMetaData> >();
            this.viewList.Add(new Lazy <IPanelView, IRegionMetaData>(() => this.panelView, this.metadata.Object));
            this.viewList.Add(new Lazy <IPanelView, IRegionMetaData>(() => new PropertyGrid(), this.metadata.Object));

            this.viewModelDecoratedList = new List <Lazy <IPanelViewModel, INameMetaData> >();
            this.viewModelDecoratedList.Add(new Lazy <IPanelViewModel, INameMetaData>(() => this.panelViewModel2, this.describeMetaData.Object));

            this.viewModelList = new List <IPanelViewModel>();
            this.viewModelList.Add(this.panelViewModel);
            this.viewModelList.Add(new PropertyGridViewModel());

            this.NavigationService = new PanelNavigationService(this.viewList, this.viewModelList, this.regionManager.Object, this.viewModelDecoratedList, this.filterStringService.Object, this.regionCollectionSearcher.Object);

            this.session           = new Mock <ISession>();
            this.permissionService = new Mock <IPermissionService>();
            this.session.Setup(x => x.PermissionService).Returns(this.permissionService.Object);
        }