err check on batch create
err check on batch create
@@ -226,8 +226,7 @@ func testBatchACKAddendaCount(t testing.TB) {
mockBatch := mockBatchACK()
addenda05 := mockAddenda05()
mockBatch.GetEntries()[0].AddAddenda05(addenda05)
- mockBatch.Create()
- if err := mockBatch.Validate(); err != nil {
+ if err := mockBatch.Create(); err != nil {
if e, ok := err.(*BatchError); ok {
if e.FieldName != "AddendaCount" {
t.Errorf("%T: %s", err, err)
@@ -256,9 +255,8 @@ func testBatchACKServiceClassCode(t testing.TB) {
mockBatch := mockBatchACK()
// Batch Header information is required to Create a batch.
mockBatch.GetHeader().ServiceClassCode = 0
- mockBatch.Create()
- if err := mockBatch.Validate(); err != nil {
- if e, ok := err.(*BatchError); ok {
+ if err := mockBatch.Create(); err != nil {
+ if e, ok := err.(*FieldError); ok {
if e.FieldName != "ServiceClassCode" {
t.Errorf("%T: %s", err, err)
}
@@ -311,8 +309,7 @@ func TestBatchACKAmount(t *testing.T) {
mockBatch := mockBatchACK()
// Batch Header information is required to Create a batch.
mockBatch.GetEntries()[0].Amount = 25000
- mockBatch.Create()
- if err := mockBatch.Validate(); err != nil {
+ if err := mockBatch.Create(); err != nil {
if e, ok := err.(*BatchError); ok {
if e.FieldName != "Amount" {
t.Errorf("%T: %s", err, err)
@@ -328,8 +325,7 @@ func TestBatchACKTransactionCode(t *testing.T) {
mockBatch := mockBatchACK()
// Batch Header information is required to Create a batch.
mockBatch.GetEntries()[0].TransactionCode = CheckingCredit
- mockBatch.Create()
- if err := mockBatch.Validate(); err != nil {
+ if err := mockBatch.Create(); err != nil {
if e, ok := err.(*BatchError); ok {
if e.FieldName != "TransactionCode" {
t.Errorf("%T: %s", err, err)
