private GarmentFinanceMemorialDetailLocalDataUtil _dataUtil(GarmentFinanceMemorialDetailLocalService service, string testname) { var memorialService = new GarmentFinanceMemorialService(GetServiceProvider().Object, service.DbContext); var memorialDataUtil = new GarmentFinanceMemorialDataUtil(memorialService); return(new GarmentFinanceMemorialDetailLocalDataUtil(service, memorialDataUtil)); }
public async Task Should_Success_Create_Data() { GarmentFinanceMemorialService service = new GarmentFinanceMemorialService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); GarmentFinanceMemorialModel model = _dataUtil(service, GetCurrentMethod()).GetNewData(); var Response = await service.CreateAsync(model); Assert.NotEqual(0, Response); }
public async Task Should_Success_Get_Data_By_Id() { GarmentFinanceMemorialService service = new GarmentFinanceMemorialService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); GarmentFinanceMemorialModel model = await _dataUtil(service, GetCurrentMethod()).GetTestData(); var Response = await service.ReadByIdAsync(model.Id); Assert.NotNull(Response); }
public async Task Should_Success_Get_Data() { GarmentFinanceMemorialService service = new GarmentFinanceMemorialService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var data = await _dataUtil(service, GetCurrentMethod()).GetTestData(); var Response = service.Read(1, 25, "{}", null, null, "{}"); Assert.NotEmpty(Response.Data); }
public async Task Should_Success_Update_Data() { GarmentFinanceMemorialService service = new GarmentFinanceMemorialService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); GarmentFinanceMemorialModel model = await _dataUtil(service, GetCurrentMethod()).GetTestData(); var newModel = await service.ReadByIdAsync(model.Id); //newModel.BGCheckNumber = "newBG"; var Response1 = await service.UpdateAsync(newModel.Id, newModel); Assert.NotEqual(0, Response1); GarmentFinanceMemorialModel model2 = await _dataUtil(service, GetCurrentMethod()).GetTestData(); //var newModel2 = await service.ReadByIdAsync(model.Id); GarmentFinanceMemorialModel newModel2 = new GarmentFinanceMemorialModel(); newModel2.Id = model2.Id; newModel2.Items = new List <GarmentFinanceMemorialItemModel> { model2.Items.First() }; newModel2.Items.First().Credit = 100; newModel2.Items.First().Debit = 100; var Response = await service.UpdateAsync(model2.Id, newModel2); Assert.NotEqual(0, Response); GarmentFinanceMemorialItemModel newItem = new GarmentFinanceMemorialItemModel { COAId = 3, COACode = "no3", COAName = "Name", Debit = 3, Credit = 0 }; GarmentFinanceMemorialItemModel newItem2 = new GarmentFinanceMemorialItemModel { COAId = 3, COACode = "no3", COAName = "Name", Credit = 3, Debit = 0 }; newModel2.Items.Add(newItem); newModel2.Items.Add(newItem2); var Response3 = await service.UpdateAsync(model2.Id, newModel2); Assert.NotEqual(0, Response); }
public GarmentFinanceMemorialDataUtil(GarmentFinanceMemorialService service) { Service = service; }
private GarmentFinanceMemorialDataUtil _dataUtil(GarmentFinanceMemorialService service, string testname) { return(new GarmentFinanceMemorialDataUtil(service)); }