public void Clone_Always_ReturnNewInstanceWithCopiedValues() { // Setup var random = new Random(21); var original = new BreakWater(random.NextEnumValue <BreakWaterType>(), random.NextDouble()); // Call object clone = original.Clone(); // Assert CoreCloneAssert.AreObjectClones(original, clone, CommonCloneAssert.AreClones); }
public override object Clone() { var clone = (StructuresInputBase <T>)base.Clone(); clone.allowedLevelIncreaseStorage = (LogNormalDistribution)AllowedLevelIncreaseStorage.Clone(); clone.storageStructureArea = (VariationCoefficientLogNormalDistribution)StorageStructureArea.Clone(); clone.flowWidthAtBottomProtection = (LogNormalDistribution)FlowWidthAtBottomProtection.Clone(); clone.criticalOvertoppingDischarge = (VariationCoefficientLogNormalDistribution)CriticalOvertoppingDischarge.Clone(); clone.widthFlowApertures = (NormalDistribution)WidthFlowApertures.Clone(); clone.stormDuration = (VariationCoefficientLogNormalDistribution)StormDuration.Clone(); clone.BreakWater = (BreakWater)BreakWater.Clone(); return(clone); }