public void SequenceEqualColl()
        {
            Assert.IsTrue(CollectionsUtility.SequenceEqual(
                              (ICollection <String>)null, (ICollection <String>)null));
            Assert.IsFalse(CollectionsUtility.SequenceEqual(
                               (ICollection <String>) new List <String>(), (ICollection <String>)null));
            Assert.IsFalse(CollectionsUtility.SequenceEqual(
                               (ICollection <String>)null, (ICollection <String>) new List <String>()));
            Assert.IsTrue(CollectionsUtility.SequenceEqual(
                              (ICollection <String>) new List <String>(), (ICollection <String>) new List <String>()));

            Assert.IsTrue(CollectionsUtility.SequenceEqual(
                              (ICollection <String>) new List <String>()
            {
                "One", "Two"
            },
                              (ICollection <String>) new List <String>()
            {
                "One", "Two"
            }));

            Assert.IsFalse(CollectionsUtility.SequenceEqual(
                               (ICollection <String>) new List <String>()
            {
                "One", "Two"
            },
                               (ICollection <String>) new List <String>()
            {
                "Two", "One"
            }));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Determines whether this instance and a specified <see cref="MultiLinePoint"/> have the
        /// same value.</summary>
        /// <param name="other">
        /// A <see cref="MultiLinePoint"/> to compare to this instance.</param>
        /// <returns>
        /// <c>true</c> if the value of <paramref name="other"/> is the same as this instance;
        /// otherwise, <c>false</c>.</returns>
        /// <remarks>
        /// <b>Equals</b> compares the values of the <see cref="Shared"/>, <see cref="Lines"/>, and
        /// <see cref="Locations"/> properties of the two <see cref="MultiLinePoint"/> instances to
        /// test for value equality.</remarks>

        public bool Equals(MultiLinePoint other)
        {
            return(Shared == other.Shared &&
                   CollectionsUtility.SequenceEqual(Lines, other.Lines) &&
                   CollectionsUtility.SequenceEqual(Locations, other.Locations));
        }