예제 #1
0
        public void GivenViewWithOutputSet_WhenOutputUpdated_ThenTableUpdated()
        {
            // Given
            MacroStabilityInwardsOutput outputWithoutSlices = MacroStabilityInwardsOutputTestFactory.CreateOutputWithoutSlices();

            var calculation = new MacroStabilityInwardsCalculationScenario
            {
                Output = outputWithoutSlices
            };

            using (var view = new MacroStabilityInwardsOutputView(calculation,
                                                                  new GeneralMacroStabilityInwardsInput(),
                                                                  AssessmentSectionTestHelper.GetTestAssessmentLevel))
            {
                MacroStabilityInwardsSlicesTable slicesTable = GetSlicesTable(view);

                // Precondition
                Assert.AreEqual(0, slicesTable.Rows.Count);

                // When
                calculation.Output = MacroStabilityInwardsOutputTestFactory.CreateOutput();
                calculation.NotifyObservers();

                // Then
                Assert.AreEqual(3, slicesTable.Rows.Count);
            }
        }