public void ActiveAwareIsReturned()
        {
            var viewViewModelWrapper = new ModelVisualizer(new MockActiveAwareViewModel(), new MockActiveAwareView());

            viewViewModelWrapper.IsActive = true;

            Assert.IsTrue(viewViewModelWrapper.IsActive);
            Assert.IsTrue((viewViewModelWrapper.View as IActiveAware).IsActive);
        }
        public void RegioncontextIsReturned()
        {
            var viewViewModelWrapper = new ModelVisualizer(new MockContextAwareView(), new MockContextAwareView());

            var payload = new MockPayload();
            (viewViewModelWrapper.View as IRegionContextAware).RegionContext.Value = payload;

            Assert.AreEqual(payload, viewViewModelWrapper.RegionContext.Value);
            Assert.AreEqual(payload, (viewViewModelWrapper.ViewModel as IRegionContextAware).RegionContext.Value);
        }
        public void ActivatingModelVisualizerThatHoldsWindowShowsWindow()
        {
            var target = new NewWindowRegionBehavior();
            target.Region = new Region();
            target.Region.Behaviors.Add("Key", new TwoWayActiveAwareBehavior());

            target.Attach();
            var mockWindow = new MockWindow();
            var modelVisualizer = new ModelVisualizer(null, mockWindow);

            target.Region.Add(modelVisualizer);

            Assert.IsFalse(mockWindow.IsShown);

            mockWindow.IsActive = true;

            Assert.IsTrue(mockWindow.IsShown);

            mockWindow.IsActive = false;

            Assert.IsFalse(mockWindow.IsShown);
        }
        public void DontSetContentIfViewIsWindow()
        {
            var viewViewModelWrapper = new ModelVisualizer(new MockActiveAwareViewModel(), new Window());

            Assert.IsNull(viewViewModelWrapper.Content);
        }