public SetIsDesignerViewVisible ( bool isVisible ) : void | ||
isVisible | bool | |
Résultat | void |
public void WorkflowDesignerViewModel_DebugSelectionChanged_DesignerViewHidden_DoesNothing() { //----------------------- Setup -----------------------// var workflow = new ActivityBuilder { Implementation = new Flowchart { StartNode = CreateFlowNode(Guid.NewGuid(), "SelectionChangedTest1", true, typeof(TestActivity)) } }; #region Setup viewModel var resourceRep = new Mock<IResourceRepository>(); resourceRep.Setup(r => r.All()).Returns(new List<IResourceModel>()); resourceRep.Setup(r => r.FetchResourceDefinition(It.IsAny<IEnvironmentModel>(), It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<bool>())).Returns(new ExecuteMessage()); var resourceModel = new Mock<IContextualResourceModel>(); resourceModel.Setup(m => m.Environment.ResourceRepository).Returns(resourceRep.Object); resourceModel.Setup(m => m.ResourceName).Returns("Some resource name 6"); var workflowHelper = new Mock<IWorkflowHelper>(); workflowHelper.Setup(h => h.CreateWorkflow(It.IsAny<string>())).Returns(workflow); var viewModel = new WorkflowDesignerViewModelMock(resourceModel.Object, workflowHelper.Object); viewModel.InitializeDesigner(new Dictionary<Type, Type>()); #endregion viewModel.SetIsDesignerViewVisible(false); //----------------------- Execute -----------------------// EventPublishers.Studio.Publish(new DebugSelectionChangedEventArgs { DebugState = new DebugState(), SelectionType = ActivitySelectionType.Single }); var result = viewModel.GetSelectedModelItemHitCount; viewModel.Dispose(); //----------------------- Assert -----------------------// Assert.AreEqual(0, result); }