public string VisualizeToString(Initiative initiative, string parentNodeID)
        {
            string result = $"[{{ v:'{initiative.NodeID}', f:'{initiative.GetType().Name}<div style=\"font-style:italic\">{initiative.Title}</div>'}}, '{parentNodeID}']";

            if (initiative.Measures.Count() >= 1)
            {
                result = result + " , " + ProcessMeasures(initiative);
            }
            ;

            if (initiative.Epics.Count() >= 1)
            {
                result = result + " , " + ProcessEpics(initiative);
            }
            ;
            return(result);
        }
예제 #2
0
        public void SetupForTest()
        {
            _testInitiative = new Initiative("Test Initiative Title");
            _parentNodeID   = "Parent Bet Node Test ID";
            _testEpic       = new Epic("Test Epic Descritpition", "Test Epic Deadline");
            _testMeasure    = new Measure("Test Measure Description", "Test Measure Deadline", 1, "Test Measure Units");

            _mockEpicPresenter = new Mock <IEpicPresenter>();
            _mockEpicPresenter.SetupSequence(mep => mep.VisualizeToString(_testEpic, _testInitiative.NodeID)).Returns("This Epic Presenter method has been mocked")
            .Returns("This mocked Epic Presenter method has been called twice");
            _mockMeasurePresenter = new Mock <IMeasurePresenter>();
            _mockMeasurePresenter.SetupSequence(mmp => mmp.VisualizeToString(_testMeasure, _testInitiative.NodeID)).Returns("This Measure Presenter method has been mocked")
            .Returns("This mocked Measure Presenter method has been called twice");

            _initiativePresenter = new InitiativePresenter(_mockEpicPresenter.Object, _mockMeasurePresenter.Object);
            _expectedInitiativeOrgChartString = $"[{{ v:'{_testInitiative.NodeID}', f:'{_testInitiative.GetType().Name}<div style=\"font-style:italic\">{_testInitiative.Title}</div>'}}, '{_parentNodeID}']";
        }