forked from moov-io/wire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_test.go
More file actions
29 lines (23 loc) · 685 Bytes
/
file_test.go
File metadata and controls
29 lines (23 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2020 The Moov Authors
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.
package wire
import (
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
)
func TestFile__FileFromJSON(t *testing.T) {
bs, err := os.ReadFile(filepath.Join("test", "testdata", "fedWireMessage-BankTransfer.json"))
if err != nil {
t.Fatal(err)
}
if len(bs) == 0 {
t.Fatal("no bytes read")
}
file, err := FileFromJSON(bs)
require.NoError(t, err)
require.Empty(t, file.ID, "id should not have been set")
require.NotNil(t, file.FEDWireMessage.FIAdditionalFIToFI, "FIAdditionalFIToFI shouldn't be nil")
}