public void CommentsMgrAdding_EventHandler_Does_Nothing_For_Now() { //Arrange var wkSpce = new WorkSpace(); //Act, Assert var ex = Assert.Throws<NotImplementedException>(() => wkSpce._utilitiesMgr_Adding(null, null)); }
public void ElementsMgrModifying_EventHandler_Does_Nothing_For_Now() { //Arrange var wkSpce = new WorkSpace(); //Act, Assert var ex = Assert.Throws<NotImplementedException>(() => wkSpce._elementsMgr_Modifying(null, null)); }
public void WorkMode_GetsWorkspaceMode() { var wkSpce = new WorkSpace(); // just to ensure it is implemented Common.WorkSpace.WorkSpaceMode actualMode = wkSpce.WorkMode; Assert.Equal(actualMode, wkSpce.WorkMode); }
public void VerifyWorkSpaceModeChangedEvent() { var wkSpce = new WorkSpace(); var helper = new HelperForWorkSpaces(); wkSpce.WorkModeChanged += new WorkSpaceModeChangeEventHandler<IWorkSpace, WorkSpaceModeChangeEventArgs>(helper.WorkModeChanged_DummyHandler); WorkSpaceMode priorMode = WorkSpaceMode.Normal; WorkSpaceMode newMode = WorkSpaceMode.Execution; var ea = new WorkSpaceModeChangeEventArgs(priorMode, newMode); wkSpce.OnWorkModeChanged(ea); Assert.Equal(1, helper.WorkModeChanged_TimesHandled); }
public void VerifyWorkSpaceExecModeChangedEvent() { var wkSpce = new WorkSpace(); var helper = new HelperForWorkSpaces(); wkSpce.ExecModeChanged+=new WorkSpaceExecModeChangeEventHandler<IWorkSpace,WorkSpaceExecModeChangeEventArgs>(helper.ExecModeChanged_DummyHandler); ExecutionModes priorMode = ExecutionModes.Single; ExecutionModes newMode = ExecutionModes.Cascade; WorkSpaceExecModeChangeEventArgs ea = new WorkSpaceExecModeChangeEventArgs(priorMode, newMode); wkSpce.OnExecModeChanged(ea); Assert.Equal(1, helper.ExecModeChanged_TimesHandled); }
public void VarMgr_VariableSelected_EventHandler_Does_Nothing_For_Now() { //Arrange var wkSpce = new WorkSpace(); //Act, Assert var ex = Assert.Throws<NotImplementedException>(() => wkSpce._varMgr_VariableSelected(null, null)); }
public void VarMgr_IdentifyVarDependents_EventHandler_Does_Nothing_For_Now() { //Arrange var wkSpce = new WorkSpace(); //Act, Assert var ex = Assert.Throws<NotImplementedException>(() => wkSpce._varMgr_IdentifyVarDependents(null, null)); }
public void element_SelectionChangedEventHandlerDoesNothingIfSender_Is_Null() { var wkSpce = new WorkSpace(); var mockElMgr = new Mock<IElements>(); var mockEl = new Mock<IElement>(); var ea = new SelectionEventArgs(true, SelectionSource.Code); mockElMgr.Setup(m => m[new Guid()]).Returns(mockEl.Object); wkSpce.ElementsMgr = mockElMgr.Object; wkSpce.element_SelectionChanged(null, ea); mockElMgr.Verify(m => m[new Guid()], Times.Never()); }
public void Reset() { var wkSpce = new WorkSpace(); var mockEls = new Mock<IElements>(); var mockEl0 = new Mock<IElement>(); var mockElMgr = new Mock<IElements>(); var roots = new List<IElement>(); roots.Add(mockEl0.Object); mockElMgr.Setup(m => m.GetRoots(false)).Returns(roots); mockEl0.Setup(m => m.Reset()); wkSpce.ElementsMgr = mockElMgr.Object; wkSpce.Reset(); mockEl0.VerifyAll(); }
public void PipeStatusChanging_EventHandler() { //Arrange var wkSpce = new WorkSpace(); //Act, Assert var ex = Assert.Throws<NotImplementedException>(() => wkSpce.pipe_StatusChanging(null, null)); }
public void ExecMode_GetsExecutionMode() { var wkSpce = new WorkSpace(); // just to ensure it is implemented Common.ExecutionModes actualMode = wkSpce.ExecMode; Assert.Equal(actualMode, wkSpce.ExecMode); }
public void ExecMode_GetsAndSetsExecutionMode() { var wkSpce = new WorkSpace(); Common.ExecutionModes newMode = ExecutionModes.Cascade; wkSpce.ExecMode = newMode; Common.ExecutionModes actualMode = wkSpce.ExecMode; Assert.Equal(newMode, actualMode); }
public void element_SelectionChangedEventHandlerSetsIsSelectedOnEachElementSelected() { var wkSpce = new WorkSpace(); var mockElMgr = new Mock<IElements>(); var mockEl = new Mock<IElement>(); var ea = new SelectionEventArgs(true, SelectionSource.Code); mockElMgr.Setup(m => m[new Guid()]).Returns(mockEl.Object); mockEl.Setup(m => m.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin)); wkSpce.ElementsMgr = mockElMgr.Object; wkSpce.element_SelectionChanged(mockEl.Object, ea); mockElMgr.Verify(m => m[new Guid()], Times.Exactly(1)); }
public void WorkMode_SetterUpdatesWorkspaceMode() { var wkSpce = new WorkSpace(); Common.WorkSpace.WorkSpaceMode currentMode = wkSpce.WorkMode; Common.WorkSpace.WorkSpaceMode newMode = WorkSpaceMode.Execution; wkSpce.WorkMode = newMode; Common.WorkSpace.WorkSpaceMode actualMode = wkSpce.WorkMode; Assert.Equal(newMode, actualMode); }
public void SettingsMgr_SettingsChanged_EventHandler_Does_Nothing_For_Now() { //Arrange var wkSpce = new WorkSpace(); //Act, Assert var ex = Assert.Throws<NotImplementedException>(() => wkSpce._settingsMgr_SettingsChanged(null, null)); }
public void _elementsMgr_AddedEventHandlerFiresElementInstancesAddedEventWhenElementsAreSuccessfullyAdded() { var wkSpce = new WorkSpace(); // verify the event handler fires the event by catching it with a helper event handler. var mockElMgr = new Mock<IElements>(); var mockEl = new Mock<IElement>(); var helper = new HelperForWorkSpaces(); wkSpce.ElementInstancesAdded += new InstanceAddedEventHandler<IWorkSpace, ElementInstancesAddedEventArgs>(helper.ElementInstancesAdded_DummyHandler); var ea = new ElementCollectionEventArgs(CollectionEventArgs.CollectionAction.Add, mockEl.Object); wkSpce.ElementsMgr = mockElMgr.Object; wkSpce._elementsMgr_Added(mockElMgr.Object, ea); Assert.Equal(1, helper.ElementInstancesAdded_TimesHandled); }
public void VariableChangedEventHandlerForwardsTheVarChangeInfoToAllElementsWhenAVariableIsModified() { var wkSpce = new WorkSpace(); var args = new VariableChangeEventArgs("Var A", Activity.Modify); var mockEl = new Mock<IElement>(); var mockVarMgr = new Mock<IVarMgr>(); var elMgr = new Common.WorkSpace.Elements(); wkSpce.ElementsMgr = elMgr; elMgr.Add(mockEl.Object); // need elements in the elMgr to update wkSpce._varMgr_VariableChanged(mockVarMgr.Object, args); mockEl.Verify(m => m.UpdateVariableDependencies(null, args.Activity), Times.AtMostOnce()); }
public void element_RequestVariableValuesEventHandlerCallsUpdateVariableDependencyValues() { var wkSpce = new WorkSpace(); var mockVarMgr = new Mock<IVarMgr>(); var mockVarA = new Mock<IVariable>(); var element = new ElementCallDummy(); string[] varNames = { "Var A"}; var ea = new RequestVariableValuesEventArgs(varNames); mockVarMgr.Setup(m => m["Var A"]).Returns(mockVarA.Object); wkSpce.VarMgr = mockVarMgr.Object; wkSpce.element_RequestVariableValues(element, ea); Assert.Equal(1, element.UpdateVariableDependencyValues_TimesCalled); }
public void element_RequestVariableValuesEventHandlerDoesNothingIfSender_Is_Null() { var wkSpce = new WorkSpace(); var mockVarMgr = new Mock<IVarMgr>(); var mockVarA = new Mock<IVariable>(); string[] varNames = { "Var A" }; var ea = new RequestVariableValuesEventArgs(varNames); mockVarMgr.Setup(m => m["Var A"]).Returns(mockVarA.Object); wkSpce.VarMgr = mockVarMgr.Object; wkSpce.element_RequestVariableValues(null, ea); mockVarMgr.Verify(m => m["Var A"], Times.Never()); }