public void AutoRegister() { mediatorMap.MapView( typeof(ViewComponent), typeof(ViewMediator), null, true, true ); ViewComponent viewComponent = new ViewComponent(); contextView.Children.Add( viewComponent ); Assert.IsTrue( mediatorMap.HasMediatorForView(viewComponent ), "Mediator should have been created for View Component" ); }
public void UnmapView() { mediatorMap.MapView( typeof(ViewComponent), typeof(ViewMediator) ); mediatorMap.UnmapView( typeof(ViewComponent) ); ViewComponent viewComponent = new ViewComponent(); contextView.Children.Add( viewComponent ); bool hasMediator = mediatorMap.HasMediatorForView( viewComponent ); Assert.IsFalse( hasMediator, "Mediator should NOT have been created for View Component" ); }
public void MediatorIsMappedAndCreatedForView() { mediatorMap.MapView( typeof(ViewComponent), typeof(ViewMediator), null, false, false ); ViewComponent viewComponent = new ViewComponent(); contextView.Children.Add( viewComponent ); IMediator mediator = mediatorMap.CreateMediator( viewComponent ); Assert.IsNotNull( mediator, "Mediator should have been created " ); Assert.IsTrue( mediatorMap.HasMediatorForView(viewComponent ), "Mediator should have been created for View Component" ); }