public void TestEqualsObject() { //Arrange //Act var result = _shopItem.Equals(new object()); //Assert Assert.False(result); }
public bool Equals(ShoppingCartItem?other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(ShopItem.Equals(other.ShopItem) && ShopItemId == other.ShopItemId && Amount == other.Amount && ShoppingCartId == other.ShoppingCartId && Id == other.Id); }
public void Update(ShopItem valueItem) { ShopItem repositoryItem = Get(valueItem.ArticleNumber); if (repositoryItem == null) { throw new Exception(String.Format("Trying to update an item that does not exist yet: ({0})", valueItem.ToString())); } if (!repositoryItem.Equals(valueItem)) { repositoryItem.Assign(valueItem); } if (!SaveOnClose) { context.Put(repositoryItem); } }