private void AssertModelsAreEqueal(PriceListItemGetModel getModel, PriceListItemPostModel postModel) { Assert.AreEqual(postModel.Amount, getModel.Amount); Assert.AreEqual(postModel.BarCode, getModel.BarCode); Assert.AreEqual(postModel.Code, getModel.Code); Assert.AreEqual(postModel.CurrencyId, getModel.CurrencyId); Assert.AreEqual(postModel.IsStockItem, getModel.IsStockItem); Assert.AreEqual(postModel.Name, getModel.Name); Assert.AreEqual(postModel.Price, getModel.Price); Assert.AreEqual(postModel.PriceType, getModel.PriceType); Assert.AreEqual(postModel.Unit, getModel.Unit); Assert.AreEqual(postModel.VatRateType, getModel.VatRateType); Assert.AreEqual(postModel.VatCodeId, getModel.VatCodeId); }
private void AssertModelsAreEqueal(PriceListItemGetModel data, PriceListItemPatchModel patchModel) { Assert.AreEqual(patchModel.Amount, data.Amount); Assert.AreEqual(patchModel.BarCode, data.BarCode); Assert.AreEqual(patchModel.Code, data.Code); Assert.AreEqual(patchModel.CurrencyId, data.CurrencyId); Assert.AreEqual(patchModel.IsStockItem, data.IsStockItem); Assert.AreEqual(patchModel.Name, data.Name); Assert.AreEqual(patchModel.Price, data.Price); Assert.AreEqual(patchModel.PriceType, data.PriceType); Assert.AreEqual(patchModel.Unit, data.Unit); Assert.AreEqual(patchModel.VatRateType, data.VatRateType); Assert.AreEqual(patchModel.VatCodeId, data.VatCodeId); }
/// <summary> /// Adds new issued invoice item containing specific amount of the price list item. /// </summary> /// <param name="items">Issued invoice items.</param> /// <param name="priceListItem">Price list item.</param> /// <param name="amount">Amount.</param> /// <returns>List.</returns> public static List <IssuedInvoiceItemPostModel> Add(this List <IssuedInvoiceItemPostModel> items, PriceListItemGetModel priceListItem, int amount) { if (priceListItem == null) { return(items); } var item = new IssuedInvoiceItemPostModel { Name = priceListItem.Name, Amount = amount, Code = priceListItem.Code, PriceType = priceListItem.PriceType, UnitPrice = priceListItem.Price, Unit = priceListItem.Unit, VatRateType = priceListItem.VatRateType, PriceListItemId = priceListItem.Id }; items?.Add(item); return(items); }