/// <summary>
        /// Returns true if Seller instances are equal
        /// </summary>
        /// <param name="other">Instance of Seller to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Seller other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                     ) &&
                 (
                     ChannelCode == other.ChannelCode ||
                     ChannelCode != null &&
                     ChannelCode.Equals(other.ChannelCode)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Geocode == other.Geocode ||
                     Geocode != null &&
                     Geocode.Equals(other.Geocode)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     InvoiceNumber == other.InvoiceNumber ||
                     InvoiceNumber != null &&
                     InvoiceNumber.Equals(other.InvoiceNumber)
                 ) &&
                 (
                     Mcc == other.Mcc ||
                     Mcc != null &&
                     Mcc.Equals(other.Mcc)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ));
        }
示例#2
0
        public void GeocodeParsingTest()
        {
            var geo   = new Geocode(10.0m, 10.0m);
            var valid = new[]
            {
                "10,10",        // without decimal points
                "10.0,10.0",    // normal
                " 10.0,10.0",   // with leading spaces
                "10.0,10.0",    // with trailing spaces
                "10.0 ,10.0 ",  // with leading space before comma
                "10.0, 10.0"    // with trailing space after comma
            };

            Array.ForEach(valid, value =>
            {
                Geocode geocode = null;
                Assert.IsTrue(Geocode.TryParse(value, out geocode), "Valid value {0} was not parsed correctly.", value);
                Assert.IsNotNull(geocode, "Geocode parsed for {0} was null.", value);
                Assert.IsTrue(geocode.Equals(geo), "Expected {0} but received {1}.", geo.ToString(), geocode.ToString());
            });
        }