From 985da3530f3101f6c07d62a6c8da94f16b0166bd Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Wed, 8 Jul 2020 10:03:47 +0200 Subject: [PATCH] Backend: Add unit tests for internal/maps --- internal/maps/country_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/maps/country_test.go b/internal/maps/country_test.go index 2d63986ec..745a14181 100644 --- a/internal/maps/country_test.go +++ b/internal/maps/country_test.go @@ -16,4 +16,13 @@ func TestCountryName(t *testing.T) { result := CountryName("us") assert.Equal(t, "USA", result) }) + + t.Run("empty", func(t *testing.T) { + result := CountryName("") + assert.Equal(t, "Unknown", result) + }) + t.Run("invalid", func(t *testing.T) { + result := CountryName("xyz") + assert.Equal(t, "Unknown", result) + }) }