public void ViewStateWatcher_Knowns_When_View_Is_Added() { context.Configure(new ContextView(contextViewObject)); IViewStateWatcher actual = context.injector.GetInstance <IViewStateWatcher>() as IViewStateWatcher; Assert.That(actual.isAdded, Is.False); contextViewObject.AddThisView(); Assert.That(actual.isAdded, Is.True); }
public void Adding_ContextView_To_Stage_Initializes_Context() { context .Install(typeof(TestSupportViewStateWatcherExtension)) .Install(typeof(StageSyncExtension)) .Configure(new ContextView(contextView)); contextView.AddThisView(); Assert.That(context.Initialized, Is.True); }
public void Setup() { injector = new RobotlegsInjector(); manager = new MediatorManager(); container = new SupportView(); container.AddThisView(); factory = new Mock <IMediatorFactory> (); }
public async void Automatically_Unprocesses_When_View_Leaves_Stage() { viewProcessorMap.Map(matchingView.GetType()).ToProcess(trackingProcessor); matchingView.AddThisView(); viewProcessorMap.Process(matchingView); matchingView.RemoveView += CheckUnprocessorsRan; matchingView.RemoveThisView(); await Task.Delay(500); }
public void Create_Mediator_Instantiates_Mediator_For_View_When_Mapped() { instance.Map(typeof(SupportView)).ToProcess(new MediatorCreator(typeof(SupportMediator))); SupportView objA = new SupportView(); instance.HandleView(objA, objA.GetType()); objA.AddThisView(); string[] expectedNotifications = new string[1] { "SupportMediator" }; Assert.That(expectedNotifications, Is.EquivalentTo(mediatorWatcher.Notifications)); }
public async void Automatically_Unprocesses_When_View_Leaves_Stage() { instance.Map(typeof(SupportView)).ToProcess(new MediatorCreator(typeof(SupportMediator))); matchingView.AddThisView(); instance.Process(matchingView); Action <IView> removeViewCallback = null; removeViewCallback = delegate(IView view) { matchingView.RemoveView -= removeViewCallback; CheckMediatorsDestroyed(view); }; matchingView.RemoveView += removeViewCallback; matchingView.RemoveThisView(); await Task.Delay(500); }