func BenchmarkAddenda10FieldInclusionForeignPaymentAmount(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10FieldInclusionForeignPaymentAmount(b)
	}
}
BenchmarkAddenda10FieldInclusionForeignPaymentAmount benchmarks validating ForeignPaymentAmount fieldInclusion
package ach
import (
	"testing"
	"github.com/moov-io/base"
)
func mockAddenda10() *Addenda10 {
	addenda10 := NewAddenda10()
	addenda10.TransactionTypeCode = "ANN"
	addenda10.ForeignPaymentAmount = 100000
	addenda10.ForeignTraceNumber = "928383-23938"
	addenda10.Name = "BEK Enterprises"
	addenda10.EntryDetailSequenceNumber = 00000001
	return addenda10
}
func TestMockAddenda10(t *testing.T) {
	addenda10 := mockAddenda10()
	if err := addenda10.Validate(); err != nil {
		t.Error("mockAddenda10 does not validate and will break other tests")
	}
}
func testAddenda10Parse(t testing.TB) {
	addenda10 := NewAddenda10()
	line := "710ANN000000000000100000928383-23938          BEK Enterprises                          0000001"
	addenda10.Parse(line)
	if addenda10.recordType != "7" {
		t.Errorf("expected %v got %v", "7", addenda10.recordType)
	}
	if addenda10.TypeCode != "10" {
		t.Errorf("expected %v got %v", "10", addenda10.TypeCode)
	}
	if addenda10.TransactionTypeCode != "ANN" {
		t.Errorf("expected %v got %v", "ANN", addenda10.TransactionTypeCode)
	}
	if addenda10.ForeignPaymentAmount != 100000 {
		t.Errorf("expected: %v got: %v", 100000, addenda10.ForeignPaymentAmount)
	}
	if addenda10.ForeignTraceNumber != "928383-23938" {
		t.Errorf("expected: %v got: %v", "928383-23938", addenda10.ForeignTraceNumber)
	}
	if addenda10.Name != "BEK Enterprises" {
		t.Errorf("expected: %s got: %s", "BEK Enterprises", addenda10.Name)
	}
	if addenda10.reserved != "      " {
		t.Errorf("expected: %v got: %v", "      ", addenda10.reserved)
	}
	if addenda10.EntryDetailSequenceNumber != 0000001 {
		t.Errorf("expected: %v got: %v", 0000001, addenda10.EntryDetailSequenceNumber)
	}
}
func TestAddenda10Parse(t *testing.T) {
	testAddenda10Parse(t)
}
func BenchmarkAddenda10Parse(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10Parse(b)
	}
}
func testAddenda10ValidRecordType(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.recordType = "63"
	err := addenda10.Validate()
	if !base.Match(err, NewErrRecordType(7)) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10ValidRecordType(t *testing.T) {
	testAddenda10ValidRecordType(t)
}
func BenchmarkAddenda10ValidRecordType(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10ValidRecordType(b)
	}
}
func testAddenda10ValidTypeCode(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.TypeCode = "65"
	err := addenda10.Validate()
	if !base.Match(err, ErrAddendaTypeCode) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10ValidTypeCode(t *testing.T) {
	testAddenda10ValidTypeCode(t)
}
func BenchmarkAddenda10ValidTypeCode(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10ValidTypeCode(b)
	}
}
func testAddenda10TypeCode10(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.TypeCode = "05"
	err := addenda10.Validate()
	if !base.Match(err, ErrAddendaTypeCode) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10TypeCode10(t *testing.T) {
	testAddenda10TypeCode10(t)
}
func BenchmarkAddenda10TypeCode10(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10TypeCode10(b)
	}
}
func testAddenda10TransactionTypeCode(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.TransactionTypeCode = "ABC"
	err := addenda10.Validate()
	if !base.Match(err, ErrTransactionTypeCode) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10TransactionTypeCode(t *testing.T) {
	testAddenda10TransactionTypeCode(t)
}
func BenchmarkAddenda10TransactionTypeCode(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10TransactionTypeCode(b)
	}
}
func testForeignTraceNumberAlphaNumeric(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.ForeignTraceNumber = "®"
	err := addenda10.Validate()
	if !base.Match(err, ErrNonAlphanumeric) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestForeignTraceNumberAlphaNumeric(t *testing.T) {
	testForeignTraceNumberAlphaNumeric(t)
}
func BenchmarkForeignTraceNumberAlphaNumeric(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testForeignTraceNumberAlphaNumeric(b)
	}
}
func testNameAlphaNumeric(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.Name = "Jas®n"
	err := addenda10.Validate()
	if !base.Match(err, ErrNonAlphanumeric) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestNameAlphaNumeric(t *testing.T) {
	testNameAlphaNumeric(t)
}
func BenchmarkNameAlphaNumeric(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testNameAlphaNumeric(b)
	}
}
func testAddenda10FieldInclusionRecordType(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.recordType = ""
	err := addenda10.Validate()
	if !base.Match(err, ErrConstructor) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10FieldInclusionRecordType(t *testing.T) {
	testAddenda10FieldInclusionRecordType(t)
}
func BenchmarkAddenda10FieldInclusionRecordType(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10FieldInclusionRecordType(b)
	}
}
func testAddenda10FieldInclusionTypeCode(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.TypeCode = ""
	err := addenda10.Validate()
	if !base.Match(err, ErrConstructor) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10FieldInclusionTypeCode(t *testing.T) {
	testAddenda10FieldInclusionTypeCode(t)
}
func BenchmarkAddenda10FieldInclusionTypeCode(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10FieldInclusionTypeCode(b)
	}
}
func testAddenda10FieldInclusionTransactionTypeCode(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.TransactionTypeCode = ""
	err := addenda10.Validate()
	if !base.Match(err, ErrFieldRequired) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10FieldInclusionTransactionTypeCode(t *testing.T) {
	testAddenda10FieldInclusionTransactionTypeCode(t)
}
func BenchmarkAddenda10FieldInclusionTransactionTypeCode(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		testAddenda10FieldInclusionTransactionTypeCode(b)
	}
}
func testAddenda10FieldInclusionForeignPaymentAmount(t testing.TB) {
	addenda10 := mockAddenda10()
	addenda10.ForeignPaymentAmount = 0
	err := addenda10.Validate()
	if !base.Match(err, nil) {
		t.Errorf("%T: %s", err, err)
	}
}
func TestAddenda10FieldInclusionForeignPaymentAmount(t *testing.T) {
	testAddenda10FieldInclusionForeignPaymentAmount(t)
}