public void UpdateAsync_Return_Success()
        {
            string           testName        = GetCurrentMethod();
            var              dbContext       = _dbContext(testName);
            IIdentityService identityService = new IdentityService {
                Username = "******"
            };
            var model = new RO_Garment()
            {
                Code = "Code",
                RO_Garment_SizeBreakdowns = new List <RO_Garment_SizeBreakdown>()
                {
                    new RO_Garment_SizeBreakdown()
                    {
                        Id        = 1,
                        ColorName = "red"
                    },
                },
                CostCalculationGarment = new CostCalculationGarment(),
            };

            dbContext.RO_Garments.Add(model);
            dbContext.SaveChanges();
            ROGarmentLogic unitUnderTest = new ROGarmentLogic(GetServiceProvider(testName).Object, identityService, dbContext);

            unitUnderTest.UpdateAsync(model.Id, model);
        }
Beispiel #2
0
        public async Task <int> UpdateAsync(int id, RO_Garment Model)
        {
            CostCalculationGarment costCalculationGarment = Model.CostCalculationGarment;

            Model.CostCalculationGarment = null;

            Model.ImagesPath = await this.AzureImageFacade.UploadMultipleImage(Model.GetType().Name, (int)Model.Id, Model.CreatedUtc, Model.ImagesFile, Model.ImagesPath);

            roGarmentLogic.UpdateAsync(id, Model);
            await DbContext.SaveChangesAsync();

            return(await UpdateCostCalAsync(costCalculationGarment, (int)Model.Id));
        }