示例#1
0
        public void ProcessNewDiagnoseOutputEntry_NewEntryWithLastAddedEntryIsBracketOpen_AddsToLastEntry()
        {
            var mock = new Mock <IDiagnoseOutputEntry>();

            mock.Setup(x => x.Type).Returns(DiagnoseType.StartBracketOutput);
            mock.Setup(x => x.Duration).Returns(1);
            mock.Setup(x => x.Gap).Returns(2);

            var threadViewModel = new ThreadViewModel(mock.Object, 0);

            threadViewModel.ProcessNewDiagnoseOutputEntry(mock.Object);

            threadViewModel.DiagnoseOutputViewModels.Should().HaveCount(1);
            threadViewModel.DiagnoseOutputViewModels[0].DiagnoseOutputViewModels.Should().HaveCount(1);
        }
示例#2
0
        ProcessNewDiagnoseOutputEntry_NewEntryWithLastAddedEntryIsNotBracketOpen_AddsDurationAndGapToTotalThreadViewModelDuration
            ()
        {
            var mock = new Mock <IDiagnoseOutputEntry>();

            mock.Setup(x => x.Type).Returns(DiagnoseType.SingleOutput);
            mock.Setup(x => x.Duration).Returns(1);
            mock.Setup(x => x.Gap).Returns(2);

            var threadViewModel = new ThreadViewModel(mock.Object, 0);

            threadViewModel.ProcessNewDiagnoseOutputEntry(mock.Object);

            threadViewModel.TotalDuration.Should().Be(6);
        }
示例#3
0
        public void ProcessNewDiagnoseOutputEntry_NewEntryWithStartBracketOutputEndBracketOutput_IsNotBracketOpen()
        {
            var mock1 = new Mock <IDiagnoseOutputEntry>();

            mock1.Setup(x => x.Type).Returns(DiagnoseType.StartBracketOutput);
            mock1.Setup(x => x.Duration).Returns(1);
            mock1.Setup(x => x.Gap).Returns(2);
            var mock2 = new Mock <IDiagnoseOutputEntry>();

            mock2.Setup(x => x.Type).Returns(DiagnoseType.EndBracketOutput);
            mock2.Setup(x => x.Duration).Returns(1);
            mock2.Setup(x => x.Gap).Returns(2);

            var threadViewModel = new ThreadViewModel(mock1.Object, 0);

            threadViewModel.ProcessNewDiagnoseOutputEntry(mock2.Object);

            threadViewModel.DiagnoseOutputViewModels[0].IsBracketOpen.Should().Be(false);
        }