| 1 |
package segment |
| 2 |
|
| 3 |
import "testing" |
| 4 |
|
| 5 |
func TestEncryptedDataSegmentUnmarshalHBCI(t *testing.T) { |
| 6 |
test := "HNVSD:999:1+@5@abcde'" |
| 7 |
|
| 8 |
enc := &EncryptedDataSegment{} |
| 9 |
|
| 10 |
err := enc.UnmarshalHBCI([]byte(test)) |
| 11 |
|
| 12 |
if err != nil { |
| 13 |
t.Logf("Expected no error, got %T:%v\n", err, err) |
| 14 |
t.Fail() |
| 15 |
} |
| 16 |
|
| 17 |
expected := NewEncryptedDataSegment([]byte("abcde")).String() |
| 18 |
actual := enc.String() |
| 19 |
|
| 20 |
if expected != actual { |
| 21 |
t.Logf("Expected segment to equal\n%q\n\tgot\n%q\n", expected, actual) |
| 22 |
t.Fail() |
| 23 |
} |
| 24 |
} |