public void An_array_of_objects_should_be_properly_serialized()
        {
            var message = new GenericArrayClass <InnerClass> {
                Values = new[] { new InnerClass {
                                     Name = "Chris"
                                 }, new InnerClass {
                                     Name = "David"
                                 } }
            };

            TestSerialization(message);
        }
Exemple #2
0
            public bool Equals(GenericArrayClass <T> other)
            {
                if (ReferenceEquals(null, other))
                {
                    return(false);
                }

                if (ReferenceEquals(this, other))
                {
                    return(true);
                }

                if (ReferenceEquals(other.Values, Values))
                {
                    return(true);
                }

                if (other.Values == null && Values != null)
                {
                    return(false);
                }

                if (other.Values != null && Values == null)
                {
                    return(false);
                }

                if (other.Values != null && Values != null)
                {
                    if (other.Values.Length != Values.Length)
                    {
                        return(false);
                    }

                    for (int i = 0; i < Values.Length; i++)
                    {
                        if (!Equals(other.Values[i], Values[i]))
                        {
                            return(false);
                        }
                    }
                }

                return(true);
            }