コード例 #1
0
        public void ShouldFindCandidateViewInRegion()
        {
            _container.RegisterForNavigation <MockView>();
            //_container.RegisterType<object, MockView>("MockView");

            // We cannot access the UnityRegionNavigationContentLoader directly so we need to call its
            // GetCandidatesFromRegion method through a navigation request.
            IRegion testRegion = new Region();

            MockView view = new MockView();

            testRegion.Add(view);
            testRegion.Deactivate(view);

            Assert.True(_container.IsRegistered <object>("MockView"));

            testRegion.RequestNavigate("MockView");

            Assert.Contains(view, testRegion.Views);
            Assert.Single(testRegion.Views);
            Assert.Single(testRegion.ActiveViews);
            Assert.Contains(view, testRegion.ActiveViews);
        }
コード例 #2
0
 public bool IsRegistered(Type type) => inner.IsRegistered(type);