public void CanRemoveViewWhenNoneActive() { var control = new ContentControl(); IRegionAdapter adapter = new TestableContentControlRegionAdapter(); MockRegion region = (MockRegion)adapter.Initialize(control, "Region1"); var mockView1 = new object(); region.Add(mockView1); region.Deactivate(mockView1); region.Remove(mockView1); Assert.AreEqual(0, region.ActiveViews.Count()); }
public void ShouldActivateAddedViewWhenNoneIsActive() { var control = new ContentControl(); IRegionAdapter adapter = new TestableContentControlRegionAdapter(); MockRegion region = (MockRegion)adapter.Initialize(control, "Region1"); var mockView1 = new object(); region.Add(mockView1); region.Deactivate(mockView1); var mockView2 = new object(); region.Add(mockView2); Assert.AreEqual(1, region.ActiveViews.Count()); Assert.IsTrue(region.ActiveViews.Contains(mockView2)); }