예제 #1
0
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 /// <typeparam name="T">The type of the top level illustration point.</typeparam>
 public static void AreClones <T>(GeneralResult <T> original, GeneralResult <T> clone)
     where T : TopLevelIllustrationPointBase
 {
     CoreCloneAssert.AreObjectClones(original.GoverningWindDirection, clone.GoverningWindDirection, AreClones);
     CoreCloneAssert.AreEnumerationClones(original.Stochasts, clone.Stochasts, AreClones);
     CoreCloneAssert.AreEnumerationClones(original.TopLevelIllustrationPoints, clone.TopLevelIllustrationPoints, AreClones);
 }
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(MacroStabilityInwardsSlipPlaneUpliftVan original,
                              MacroStabilityInwardsSlipPlaneUpliftVan clone)
 {
     CoreCloneAssert.AreObjectClones(original.LeftGrid, clone.LeftGrid, AreClones);
     CoreCloneAssert.AreObjectClones(original.RightGrid, clone.RightGrid, AreClones);
     CoreCloneAssert.AreEnumerationClones(original.TangentLines, clone.TangentLines,
                                          (originalTangentLine, clonedTangentLine) =>
                                          Assert.AreEqual(originalTangentLine, clonedTangentLine));
 }
        /// <summary>
        /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
        /// are clones.
        /// </summary>
        /// <param name="original">The original object.</param>
        /// <param name="clone">The cloned object.</param>
        /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
        /// <paramref name="clone"/> are not clones.</exception>
        public static void AreClones(MacroStabilityInwardsSlidingCurve original,
                                     MacroStabilityInwardsSlidingCurve clone)
        {
            CoreCloneAssert.AreObjectClones(original.LeftCircle, clone.LeftCircle, AreClones);
            CoreCloneAssert.AreObjectClones(original.RightCircle, clone.RightCircle, AreClones);
            CoreCloneAssert.AreEnumerationClones(original.Slices, clone.Slices, AreClones);

            Assert.AreEqual(original.NonIteratedHorizontalForce, clone.NonIteratedHorizontalForce);
            Assert.AreEqual(original.IteratedHorizontalForce, clone.IteratedHorizontalForce);
        }
        public void Clone_Always_ReturnNewInstanceWithEmptyObservers()
        {
            // Setup
            var mocks    = new MockRepository();
            var original = new CloneableObservableList <object>
            {
                new object(),
                new object()
            };
            var observer = mocks.Stub <IObserver>();

            original.Attach(observer);

            mocks.ReplayAll();

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

            // Assert
            CoreCloneAssert.AreEnumerationClones(original, clone, Assert.AreEqual);
            CollectionAssert.IsEmpty(((CloneableObservableList <object>)clone).Observers);

            mocks.VerifyAll();
        }
예제 #5
0
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(WaveImpactAsphaltCoverWaveConditionsOutput original, WaveImpactAsphaltCoverWaveConditionsOutput clone)
 {
     CoreCloneAssert.AreEnumerationClones(original.Items, clone.Items, WaveConditionsCloneAssert.AreClones);
 }
예제 #6
0
        /// <summary>
        /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
        /// are clones.
        /// </summary>
        /// <param name="original">The original object.</param>
        /// <param name="clone">The cloned object.</param>
        /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
        /// <paramref name="clone"/> are not clones.</exception>
        public static void AreClones(CalculationGroup original, CalculationGroup clone)
        {
            AreClones((ICalculationBase)original, clone);

            CoreCloneAssert.AreEnumerationClones(original.Children, clone.Children, AreClones);
        }
예제 #7
0
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(GeneralResult <TopLevelFaultTreeIllustrationPoint> original, GeneralResult <TopLevelFaultTreeIllustrationPoint> clone)
 {
     CoreCloneAssert.AreObjectClones(original.GoverningWindDirection, clone.GoverningWindDirection, AreClones);
     CoreCloneAssert.AreEnumerationClones(original.Stochasts, clone.Stochasts, AreClones);
     CoreCloneAssert.AreEnumerationClones(original.TopLevelIllustrationPoints, clone.TopLevelIllustrationPoints, AreClones);
 }
예제 #8
0
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(IllustrationPointNode original, IllustrationPointNode clone)
 {
     CoreCloneAssert.AreObjectClones(original.Data, clone.Data, AreClones);
     CoreCloneAssert.AreEnumerationClones(original.Children, clone.Children, AreClones);
 }
예제 #9
0
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(FaultTreeIllustrationPoint original, FaultTreeIllustrationPoint clone)
 {
     AreClones((IllustrationPointBase)original, clone);
     CoreCloneAssert.AreEnumerationClones(original.Stochasts, clone.Stochasts, AreClones);
     Assert.AreEqual(original.CombinationType, clone.CombinationType);
 }
예제 #10
0
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(SubMechanismIllustrationPoint original, SubMechanismIllustrationPoint clone)
 {
     AreClones((IllustrationPointBase)original, clone);
     CoreCloneAssert.AreEnumerationClones(original.Stochasts, clone.Stochasts, AreClones);
     CoreCloneAssert.AreEnumerationClones(original.IllustrationPointResults, clone.IllustrationPointResults, AreClones);
 }
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(StabilityStoneCoverWaveConditionsOutput original, StabilityStoneCoverWaveConditionsOutput clone)
 {
     CoreCloneAssert.AreEnumerationClones(original.BlocksOutput, clone.BlocksOutput, WaveConditionsCloneAssert.AreClones);
     CoreCloneAssert.AreEnumerationClones(original.ColumnsOutput, clone.ColumnsOutput, WaveConditionsCloneAssert.AreClones);
 }
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(GrassCoverErosionOutwardsWaveConditionsOutput original, GrassCoverErosionOutwardsWaveConditionsOutput clone)
 {
     CoreCloneAssert.AreEnumerationClones(original.WaveRunUpOutput, clone.WaveRunUpOutput, WaveConditionsCloneAssert.AreClones);
     CoreCloneAssert.AreEnumerationClones(original.WaveImpactOutput, clone.WaveImpactOutput, WaveConditionsCloneAssert.AreClones);
     CoreCloneAssert.AreEnumerationClones(original.WaveImpactWithWaveDirectionOutput, clone.WaveImpactWithWaveDirectionOutput, WaveConditionsCloneAssert.AreClones);
 }