Skip to content

Commit

Permalink
Merge pull request #74 from nownabe/smbc3
Browse files Browse the repository at this point in the history
Add tests for SMBC new CSV
  • Loading branch information
nownabe authored Jan 23, 2022
2 parents 5380615 + 430f95b commit 37786ed
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/handlers/csv/smbc_statement2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
�N����,�����o��,���a����,����舵�����e,�c��,����,���x��
2020/10/12,-12200,,"�~�c�C�X�~�g���J-�h (�J",172991,,
2020/10/5,-1900,,"�~�c�C�X�~�g���J-�h (�J",185191,,
2020/9/28,-12571,,"�~�c�C�X�~�g���J-�h (�J",187091,,
2020/9/28,-15000,,"�~�c�C�X�~�g���J-�h (�J",199662,,
2020/9/28,-194873,,"�~�c�C�X�~�g���J-�h (�J",214662,,
2020/9/17,,240000,"�U���@�X�~�g���^���E",409535,,
26 changes: 26 additions & 0 deletions contrib/handlers/smbc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,29 @@ func Test_SMBCStatement(t *testing.T) {

assertEqual(t, expected, tl.result)
}

func Test_SMBCStatement2(t *testing.T) {
t.Parallel()

const csv = "csv/smbc_statement2.csv"

expected := [][]string{
{"2020-10-12", "-12200", "", "ミツイスミトモカ-ド (カ", "172991", "", ""},
{"2020-10-05", "-1900", "", "ミツイスミトモカ-ド (カ", "185191", "", ""},
{"2020-09-28", "-12571", "", "ミツイスミトモカ-ド (カ", "187091", "", ""},
{"2020-09-28", "-15000", "", "ミツイスミトモカ-ド (カ", "199662", "", ""},
{"2020-09-28", "-194873", "", "ミツイスミトモカ-ド (カ", "214662", "", ""},
{"2020-09-17", "", "240000", "振込 スミトモタロウ", "409535", "", ""},
}

h, tl := buildTestHandler(t, csv, handlers.SMBCStatement)

name := "path_to/smbc_statement2.csv"
e := bqloader.Event{Name: name, Bucket: "bucket"}

if err := h.Handle(context.Background(), e); err != nil {
t.Errorf("Unexpected error: %v", err)
}

assertEqual(t, expected, tl.result)
}

0 comments on commit 37786ed

Please sign in to comment.