Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingSoilLayerTableTest.cs =================================================================== diff -u -rfe90a6d174a01975381e6cda55ed1f7f4e831a51 -rfe9be55b75061a8035a3388a2d1bb8f80d49f0f8 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingSoilLayerTableTest.cs (.../PipingSoilLayerTableTest.cs) (revision fe90a6d174a01975381e6cda55ed1f7f4e831a51) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingSoilLayerTableTest.cs (.../PipingSoilLayerTableTest.cs) (revision fe9be55b75061a8035a3388a2d1bb8f80d49f0f8) @@ -191,6 +191,45 @@ } } + [Test] + public void SetData_WithEmptyNameAndColor_ExpectedValuesInTable() + { + // Setup + using (var table = new PipingSoilLayerTable()) + { + PipingSoilLayer soilLayer = CreatePipingSoilLayer(); + soilLayer.MaterialName = string.Empty; + soilLayer.Color = Color.Empty; + + var layers = new[] + { + soilLayer + }; + table.SetData(new[] + { + new PipingSoilLayer(1.0) + }); + + // Call + table.SetData(layers); + + // Assert + PipingSoilLayer pipingSoilLayer = layers[0]; + DataGridViewCellCollection rowCells = table.Rows[0].Cells; + AssertColumnValueEqual("Onbekend", rowCells[nameColumnIndex].Value); + AssertColumnValueEqual(Color.White, rowCells[colorColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.Top, rowCells[topColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.IsAquifer, rowCells[isAquiferColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.PermeabilityMean, rowCells[permeabilityMeanColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.PermeabilityCoefficientOfVariation, rowCells[permeabilityCoefficientOfVariationColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.DiameterD70Mean, rowCells[d70MeanColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.DiameterD70CoefficientOfVariation, rowCells[d70CoefficientOfVariationColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.BelowPhreaticLevelMean, rowCells[belowPhreaticLevelWeightMeanColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.BelowPhreaticLevelDeviation, rowCells[belowPhreaticLevelWeightDeviationColumnIndex].Value); + AssertColumnValueEqual(pipingSoilLayer.BelowPhreaticLevelShift, rowCells[belowPhreaticLevelWeightShiftColumnIndex].Value); + } + } + private void AssertColumnValueEqual(object expectedValue, object actualValue) { if (expectedValue is string || expectedValue is Color)