public async Task Should_Success_Delete_Data() { var dbContext = _dbContext(GetCurrentAsyncMethod()); var serviceProviderMock = GetServiceProvider(); serviceProviderMock .Setup(s => s.GetService(typeof(CoreDbContext))) .Returns(dbContext); var service = new AccountingCategoryService(serviceProviderMock.Object); var data = await _dataUtil(service).GetTestData(); var Response = await service.DeleteModel(data.Id); Assert.NotEqual(0, Response); }
public void Should_Success_UploadData() { var dbContext = _dbContext(GetCurrentAsyncMethod()); var serviceProviderMock = GetServiceProvider(); serviceProviderMock .Setup(s => s.GetService(typeof(CoreDbContext))) .Returns(dbContext); var service = new AccountingCategoryService(serviceProviderMock.Object); List <Lib.Models.AccountingCategory> data = new List <Lib.Models.AccountingCategory>(); data.Add(new Lib.Models.AccountingCategory()); var Response = service.UploadData(data); Assert.NotNull(Response); }
public AccountingCategoryDataUtil(AccountingCategoryService service) { Service = service; }
private AccountingCategoryDataUtil _dataUtil(AccountingCategoryService service) { return(new AccountingCategoryDataUtil(service)); }