public void GetViewWithNullOrEmptyStringThrows() { var control = new MockControl(); IRegion region = new RegionBase(control); IView myView = new MockView(); region.GetView(string.Empty); }
public void GetViewReturnsNullWhenViewDoesNotExistInRegion() { var control = new MockControl(); IRegion region = new RegionBase(control); IView myView = new MockView(); Assert.IsNull(region.GetView("InexistentView")); }
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")); }
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); }