public async Task Should_Success_Create_Data() { var service = new LockTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var model = _dataUtil(service).GetNewData(); var Response = await service.CreateAsync(model); Assert.NotEqual(0, Response); }
public async Task Should_Success_Get_Data_By_Type() { var service = new LockTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var model = await _dataUtil(service).GetTestData(); var Response = await service.GetLastActiveLockTransaction(model.Type); Assert.NotNull(Response); }
public async Task Should_Success_Get_Data() { var service = new LockTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); await _dataUtil(service).GetTestData(); var Response = service.Read(1, 25, "{}", null, null, "{}"); Assert.NotEmpty(Response.Data); }
public async Task Should_Success_Update_Data() { var service = new LockTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var model = await _dataUtil(service).GetTestData(); var newModel = await service.ReadByIdAsync(model.Id); newModel.Description += "[Updated]"; var Response = await service.UpdateAsync(newModel.Id, newModel); Assert.NotEqual(0, Response); }
public LockTransactionDataUtil(LockTransactionService service) { _service = service; }
private LockTransactionDataUtil _dataUtil(LockTransactionService service) { GetServiceProvider(); return(new LockTransactionDataUtil(service)); }