public void InsertDataJabatanTest() { InsertDataJabatanRequest request = new InsertDataJabatanRequest(); request.Jabatan = _jabatanValidData; InsertDataJabatanResponse response = _jabatanService.InsertDataJabatan(request); Assert.IsTrue(response.Messages.Count == 0, "Failed insert data"); }
public InsertDataJabatanResponse InsertDataJabatan(InsertDataJabatanRequest request) { InsertDataJabatanResponse response = new InsertDataJabatanResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { _jabatanRepo.Add(request.Jabatan); transScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } return(response); }