Пример #1
0
        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);
        }
Пример #2
0
        public void ShouldCreateNewMandatoryListProdcut()
        {
            MandatoryListProduct product = new MandatoryListProduct();

            product.Add();

            Assert.Equal(ObjectState.Added, product.State);
        }
Пример #3
0
        public void ShouldDeActivateMandatoryListProduct()
        {
            MandatoryListProduct product = new MandatoryListProduct();

            product.SetInActive();

            Assert.False(product.IsActive);
            Assert.Equal(ObjectState.Modified, product.State);
        }
Пример #4
0
        public MandatoryList GetMandatoryListWithProdcuts()
        {
            MandatoryList        mandatoryList = new MandatoryList();
            MandatoryListProduct product       = GetMandatoryListProdcut();

            mandatoryList.Products = new List <MandatoryListProduct>()
            {
                product,
                product
            };
            mandatoryList.Add();

            return(mandatoryList);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        public MandatoryList GetMandatoryListWithStatusWaitingApprove()
        {
            MandatoryList        mandatoryList = new MandatoryList();
            MandatoryListProduct product       = GetMandatoryListProdcut();

            mandatoryList.Products = new List <MandatoryListProduct>()
            {
                product,
                product
            };
            mandatoryList.Add();
            mandatoryList.SendToApproval();

            return(mandatoryList);
        }