Beispiel #1
0
 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);
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 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;
 }
Beispiel #6
0
 private LockTransactionDataUtil _dataUtil(LockTransactionService service)
 {
     GetServiceProvider();
     return(new LockTransactionDataUtil(service));
 }