private void AssertTargetItem(TargetItem targetItem, TargetItem savedTargetItem)
 {
     Assert.AreEqual(targetItem.Product.ProductId, savedTargetItem.Product.ProductId);
     Assert.AreEqual(targetItem.Quantity, savedTargetItem.Quantity);
     Assert.AreEqual(targetItem.Target.Id, savedTargetItem.Target.Id);
     Assert.AreEqual(targetItem._Status, EntityStatus.Active);
 }
 public TargetItemDTO Map(TargetItem targetItem)
 {
     if (targetItem == null)
         return null;
     return Mapper.Map<TargetItem, TargetItemDTO>(targetItem);
 }
 protected Guid AddTargetItem(Guid prod, decimal qty, Guid target)
 {
     TargetItem targetitem = new TargetItem(Guid.NewGuid())
     {
       
         Product=new ProductRef{ProductId=prod},
         Target = _targetRepository.GetById(target),
         Quantity = qty,
       
     };
     targetitem._SetStatus(EntityStatus.Active);
     return _targetItemRepository.Save(targetitem);
 }