public void The_Hyphens_In_An_Isbn_Do_Not_Affect_Equality() { var one = new Isbn("978-0-123456789"); var other = new Isbn("9780123456789"); one.Equals(other).Should().BeTrue(); (one == other).Should().BeTrue(); }
public override bool Equals(object obj) { if (!(obj is Book)) { return(false); } var other = (Book)obj; return(Isbn.Equals(other.Isbn) && Title.Equals(other.Title) && Author.Equals(other.Author) && Year.Equals(other.Year) && Category.Equals(other.Category)); }
public override bool Equals(object obj) { if (!(obj is Book)) { return(false); } Book other = (Book)obj; return(Title.Equals(other.Title) && Author.Equals(other.Author) && Year.Equals(other.Year) && Isbn.Equals(other.Isbn)); }
public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } var other = (BookSearchResult)obj; return(LibraryId.Equals(other.LibraryId) && LibraryName.Equals(other.LibraryName) && LibraryPicture.Equals(other.LibraryPicture) && Title.Equals(other.Title) && Author.Equals(other.Author) && PublishYear.Equals(other.PublishYear) && Isbn.Equals(other.Isbn)); }
/// <summary> /// Returns true if Livro instances are equal /// </summary> /// <param name="other">Instance of Livro to be compared</param> /// <returns>Boolean</returns> public bool Equals(Livro other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Isbn == other.Isbn || Isbn != null && Isbn.Equals(other.Isbn) ) && ( Titulo == other.Titulo || Titulo != null && Titulo.Equals(other.Titulo) ) && ( Autor == other.Autor || Autor != null && Autor.Equals(other.Autor) ) && ( Genero == other.Genero || Genero != null && Genero.Equals(other.Genero) ) && ( Data == other.Data || Data != null && Data.Equals(other.Data) ) && ( Preco == other.Preco || Preco != null && Preco.Equals(other.Preco) )); }
/// <summary> /// Returns true if Item instances are equal /// </summary> /// <param name="other">Instance of Item to be compared</param> /// <returns>Boolean</returns> public bool Equals(Item other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Upc == other.Upc || Upc != null && Upc.Equals(other.Upc) ) && ( Ean == other.Ean || Ean != null && Ean.Equals(other.Ean) ) && ( Isbn == other.Isbn || Isbn != null && Isbn.Equals(other.Isbn) ) && ( Asin == other.Asin || Asin != null && Asin.Equals(other.Asin) ) && ( Title == other.Title || Title != null && Title.Equals(other.Title) ) && ( Sku == other.Sku || Sku != null && Sku.Equals(other.Sku) ) && ( Mpn == other.Mpn || Mpn != null && Mpn.Equals(other.Mpn) ) && ( PartNumber == other.PartNumber || PartNumber != null && PartNumber.Equals(other.PartNumber) ) && ( Upcs == other.Upcs || Upcs != null && other.Upcs != null && Upcs.SequenceEqual(other.Upcs) ) && ( Description == other.Description || Description != null && Description.Equals(other.Description) ) && ( Brand == other.Brand || Brand != null && Brand.Equals(other.Brand) ) && ( Manufacturer == other.Manufacturer || Manufacturer != null && Manufacturer.Equals(other.Manufacturer) ) && ( Color == other.Color || Color != null && Color.Equals(other.Color) ) && ( NewPrice == other.NewPrice || NewPrice.Equals(other.NewPrice) ) && ( UsedPrice == other.UsedPrice || UsedPrice.Equals(other.UsedPrice) ) && ( CurrencyCode == other.CurrencyCode || CurrencyCode != null && CurrencyCode.Equals(other.CurrencyCode) ) && ( Url == other.Url || Url != null && Url.Equals(other.Url) ) && ( Features == other.Features || Features != null && other.Features != null && Features.SequenceEqual(other.Features) ) && ( Dimensions == other.Dimensions || Dimensions != null && other.Dimensions != null && Dimensions.SequenceEqual(other.Dimensions) ) && ( Images == other.Images || Images != null && other.Images != null && Images.SequenceEqual(other.Images) ) && ( MatchedItems == other.MatchedItems || MatchedItems != null && other.MatchedItems != null && MatchedItems.SequenceEqual(other.MatchedItems) ) && ( IsoCountryCodes == other.IsoCountryCodes || IsoCountryCodes != null && other.IsoCountryCodes != null && IsoCountryCodes.SequenceEqual(other.IsoCountryCodes) ) && ( CompanyName == other.CompanyName || CompanyName != null && CompanyName.Equals(other.CompanyName) ) && ( CompanyAddress == other.CompanyAddress || CompanyAddress != null && CompanyAddress.Equals(other.CompanyAddress) ) && ( Categories == other.Categories || Categories != null && other.Categories != null && Categories.SequenceEqual(other.Categories) ) && ( CategoryHierarchies == other.CategoryHierarchies || CategoryHierarchies != null && other.CategoryHierarchies != null && CategoryHierarchies.SequenceEqual(other.CategoryHierarchies) )); }
public bool Equals(Libro otro) { return(Isbn.Equals(otro.Isbn) && Paginas.Equals(otro.Paginas)); }