public MandatoryList GetMandatoryListWithStatusApproveAndChangeRequest() { List <MandatoryListChangeRequest> mandatoryListChangeRequests = new List <MandatoryListChangeRequest>(); MandatoryListChangeRequest changeRequest = new MandatoryListChangeRequest() { DivisionCode = "1010", DivisionNameAr = "Name Ar", DivisionNameEn = "Name En", Products = new List <MandatoryListProductChangeRequest>() { GetMandatoryListProductChangeRequest(), GetMandatoryListProductChangeRequest() } }; changeRequest.Add(); mandatoryListChangeRequests.Add(changeRequest); MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.ChangeRequests = mandatoryListChangeRequests; mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); mandatoryList.SendToApproval(); mandatoryList.Approve(); return(mandatoryList); }
public void ShouldCreateNewMandatoryListProdcut() { MandatoryListProduct product = new MandatoryListProduct(); product.Add(); Assert.Equal(ObjectState.Added, product.State); }
public void ShouldDeActivateMandatoryListProduct() { MandatoryListProduct product = new MandatoryListProduct(); product.SetInActive(); Assert.False(product.IsActive); Assert.Equal(ObjectState.Modified, product.State); }
public MandatoryList GetMandatoryListWithProdcuts() { MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); return(mandatoryList); }
public void ShouldUpdateMandatoryListProduct() { MandatoryListProduct product = new MandatoryListProduct(); MandatoryListProduct updatedProduct = new MandatoryListDefault().GetMandatoryListProdcut(); product.Update(updatedProduct); Assert.Equal(updatedProduct.NameAr, product.NameAr); Assert.Equal(updatedProduct.NameEn, product.NameEn); Assert.Equal(updatedProduct.CSICode, product.CSICode); Assert.Equal(updatedProduct.DescriptionAr, product.DescriptionAr); Assert.Equal(updatedProduct.DescriptionEn, product.DescriptionEn); Assert.Equal(updatedProduct.PriceCelling, product.PriceCelling); Assert.Equal(ObjectState.Modified, product.State); }
public MandatoryListProduct GetMandatoryListProdcut() { MandatoryListProduct product = new MandatoryListProduct() { CSICode = "1010", NameAr = "First Product", NameEn = "First Product", PriceCelling = 10, DescriptionAr = "Hello First Product", DescriptionEn = "English Description", MandatoryListId = 1, }; return(product); }
public MandatoryList GetMandatoryListWithStatusRejected() { MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); mandatoryList.SendToApproval(); mandatoryList.Reject("Test"); return(mandatoryList); }
public MandatoryList GetMandatoryListWithStatusWaitingApprove() { MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); mandatoryList.SendToApproval(); return(mandatoryList); }