From 7779b6098707463d4a2f43cc21bddf7c1a648ddc Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Sat, 23 Sep 2017 16:02:51 +0200 Subject: [PATCH] Adding unit test for ToURL Signed-off-by: Jonas Franz --- plugin_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugin_test.go diff --git a/plugin_test.go b/plugin_test.go new file mode 100644 index 0000000..ec13be2 --- /dev/null +++ b/plugin_test.go @@ -0,0 +1,11 @@ +package main + +import "testing" + +func TestConfig_ToURL(t *testing.T) { + exampleConfig := &Config{Identifier: "test", Key: "MYKEY"} + result := exampleConfig.ToURL() + if result != "https://api.crowdin.com/api/project/test/update-file?key=MYKEY" { + t.Fatalf("ToURL returns \"%s\" instead of the expected \"%s\"", result, "https://api.crowdin.com/api/project/test/update-file?key=MYKEY") + } +}