public void ShowPropertiesFor_Always_PropertiesInitializedOrBroughtToFront() { // Setup var mocks = new MockRepository(); var propertyResolver = mocks.Stub <IPropertyResolver>(); var mainWindow = mocks.Stub <IMainWindow>(); mainWindow.Expect(w => w.InitPropertiesWindowOrBringToFront()); mocks.ReplayAll(); var commandHandler = new ApplicationFeatureCommandHandler(propertyResolver, mainWindow); // Call commandHandler.ShowPropertiesForSelection(); // Assert mocks.VerifyAll(); }
public void CanShowPropertiesFor_ObjectDoesNotHaveProperties_ReturnFalse() { // Setup var target = new object(); var mocks = new MockRepository(); var propertyResolver = mocks.Stub <IPropertyResolver>(); propertyResolver.Expect(r => r.GetObjectProperties(target)) .Return(null); var mainWindow = mocks.Stub <IMainWindow>(); mocks.ReplayAll(); var commandHandler = new ApplicationFeatureCommandHandler(propertyResolver, mainWindow); // Call bool result = commandHandler.CanShowPropertiesFor(target); // Assert Assert.IsFalse(result); mocks.VerifyAll(); }
private void InitializeWindows() { InitializeMainWindow(); ViewHost = mainWindow.ViewHost; ViewHost.ViewClosed += OnViewClosed; ViewHost.ActiveViewChanged += OnActiveViewChanged; DocumentViewController = new DocumentViewController(ViewHost, Plugins.SelectMany(p => p.GetViewInfos()), mainWindow); PropertyResolver = new PropertyResolver(Plugins.SelectMany(p => p.GetPropertyInfos()) .Concat(ChartPropertyInfoFactory.Create()) .Concat(MapPropertyInfoFactory.Create())); applicationFeatureCommands = new ApplicationFeatureCommandHandler(PropertyResolver, mainWindow); mainWindow.InitializeToolWindows(); foreach (StateInfo stateInfo in Plugins.SelectMany(pluginGui => pluginGui.GetStateInfos())) { stateInfoLookup[mainWindow.AddStateButton(stateInfo.Name, stateInfo.Symbol, stateInfo.FontFamily, stateInfo.GetRootData)] = stateInfo; } mainWindow.SubscribeToGui(); }