コード例 #1
0
        public void GetViewWithNullOrEmptyStringThrows()
        {
            var     control = new MockControl();
            IRegion region  = new RegionBase(control);
            IView   myView  = new MockView();

            region.GetView(string.Empty);
        }
コード例 #2
0
        public void GetViewReturnsNullWhenViewDoesNotExistInRegion()
        {
            var     control = new MockControl();
            IRegion region  = new RegionBase(control);
            IView   myView  = new MockView();

            Assert.IsNull(region.GetView("InexistentView"));
        }
コード例 #3
0
        public void GetViewReturnsNullAfterRemovingViewFromRegion()
        {
            var     control = new MockControl();
            IRegion region  = new RegionBase(control);
            IView   myView  = new MockView();

            region.Add(myView, "MyView");
            region.Remove(myView);

            Assert.IsNull(region.GetView("MyView"));
        }
コード例 #4
0
        public void CanAddAndRetrieveNamedViewInstance()
        {
            var     control = new MockControl();
            IRegion region  = new RegionBase(control);
            IView   myView  = new MockView();

            region.Add(myView, "MyView");
            object returnedView = region.GetView("MyView");

            Assert.IsNotNull(returnedView);
            Assert.AreSame(returnedView, myView);
        }