From 749c2e9f3a74af21b990445bcdea9fe811f29bea Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Sat, 8 Apr 2017 10:55:11 -0400 Subject: [PATCH] Add test for RandomUID --- types_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types_test.go b/types_test.go index 1ca3616..d07803e 100644 --- a/types_test.go +++ b/types_test.go @@ -363,3 +363,13 @@ func TestUIDRecommendedFormat(t *testing.T) { t.Fatalf("UID should have failed validation because its hyphens have been replaced\n") } } + +func TestRandomUID(t *testing.T) { + uid, err := ofxgo.RandomUID() + if err != nil { + t.Fatalf("Unexpected error when calling RandomUID: %s\n", err) + } + if ok, err := uid.RecommendedFormat(); !ok || err != nil { + t.Fatalf("UID generated with RandomUID() doesn't match recommended format: %s\n", err) + } +}