private void ComputeTaxPrice(RoomSupplement entity) { if (entity.Tax != null) { Tax associatedTax = entity.Tax; orig.PriceTTC = ComputePrice.ComputePriceFromPercentOrAmount((Decimal)entity.PriceHT, (EValueType)associatedTax.ValueType, (Decimal)associatedTax.Price); } }
public void DeleteRoomSupplement() { RoomSupplement toDelete = ctx.RoomSupplementSet.FirstOrDefault(p => p.Title == "supp1"); Assert.IsNotNull(ctx.TaxSet.FirstOrDefault(p => p.Title == "Tax1")); Assert.AreNotEqual(0, ctx.SupplementRoomBookingSet.Include("RoomSupplement").Where(p => p.RoomSupplement.Id == toDelete.Id).ToList().Count); repo.Delete(toDelete); repo.Save(); Assert.AreEqual(0, ctx.SupplementRoomBookingSet.Include("RoomSupplement").Where(p => p.RoomSupplement.Id == toDelete.Id).ToList().Count); }