Exemple #1
0
        public void GetViewWithNullOrEmptyStringThrows()
        {
            var ex = Assert.Throws <ArgumentException>(() =>
            {
                IRegion region = new Region();

                region.GetView(string.Empty);
            });
        }
Exemple #2
0
        public void GetViewReturnsNullAfterRemovingViewFromRegion()
        {
            IRegion region = new Region();
            var     myView = new ContentView();

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

            Assert.Null(region.GetView("MyView"));
        }
Exemple #3
0
        public void CanAddAndRetrieveNamedViewInstance()
        {
            IRegion region = new Region();
            object myView = new object();
            region.Add(myView, "MyView");
            object returnedView = region.GetView("MyView");

            Assert.IsNotNull(returnedView);
            Assert.AreSame(returnedView, myView);
        }
Exemple #4
0
        public void CanAddAndRetrieveNamedViewInstance()
        {
            IRegion region = new Region();
            var     myView = new ContentView();

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

            Assert.NotNull(returnedView);
            Assert.Same(returnedView, myView);
        }
Exemple #5
0
        public void GetViewWithNullOrEmptyStringThrows()
        {
            IRegion region = new Region();

            region.GetView(string.Empty);
        }
Exemple #6
0
        public void GetViewReturnsNullWhenViewDoesNotExistInRegion()
        {
            IRegion region = new Region();

            Assert.IsNull(region.GetView("InexistentView"));
        }
Exemple #7
0
        public void GetViewReturnsNullAfterRemovingViewFromRegion()
        {
            IRegion region = new Region();
            object myView = new object();
            region.Add(myView, "MyView");
            region.Remove(myView);

            Assert.IsNull(region.GetView("MyView"));
        }
Exemple #8
0
        public void GetViewReturnsNullWhenViewDoesNotExistInRegion()
        {
            IRegion region = new Region();

            Assert.Null(region.GetView("InexistentView"));
        }