コード例 #1
0
        public void Clone_AllPropertiesSet_ReturnNewInstanceWithCopiedValues()
        {
            // Setup
            var surfaceLine = new MacroStabilityInwardsSurfaceLine("Surface line");

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(0, 0, 0),
                new Point3D(1, 1, 1)
            });

            MacroStabilityInwardsStochasticSoilModel   stochasticSoilModel   = MacroStabilityInwardsStochasticSoilModelTestFactory.CreateValidStochasticSoilModel();
            MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = stochasticSoilModel.StochasticSoilProfiles.First();

            // Precondition
            Assert.IsNotNull(stochasticSoilProfile);

            var original = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties());

            MacroStabilityInwardsTestDataGenerator.SetRandomMacroStabilityInwardsInput(original);

            // Call
            object clone = original.Clone();

            // Assert
            CoreCloneAssert.AreObjectClones(original, clone, MacroStabilityInwardsCloneAssert.AreClones);
        }
コード例 #2
0
        public void Clone_NoPropertiesSet_ReturnNewInstanceWithCopiedValues()
        {
            // Setup
            var original = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties());

            // Call
            object clone = original.Clone();

            // Assert
            CoreCloneAssert.AreObjectClones(original, clone, MacroStabilityInwardsCloneAssert.AreClones);
        }