Пример #1
0
 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);
 }
Пример #2
0
 public TargetItemDTO Map(TargetItem targetItem)
 {
     if (targetItem == null)
         return null;
     return Mapper.Map<TargetItem, TargetItemDTO>(targetItem);
 }
Пример #3
0
 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);
 }