From fb84ff2d209ec04d8dff61546169b116cb067ce4 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Thu, 28 Oct 2021 22:37:58 +0200 Subject: [PATCH] add tests for fistline and followage --- pkg/api/ivr/firstline_test.go | 18 ++++++++++++++++++ pkg/api/ivr/followage_test.go | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 pkg/api/ivr/firstline_test.go create mode 100644 pkg/api/ivr/followage_test.go diff --git a/pkg/api/ivr/firstline_test.go b/pkg/api/ivr/firstline_test.go new file mode 100644 index 0000000..900c0a8 --- /dev/null +++ b/pkg/api/ivr/firstline_test.go @@ -0,0 +1,18 @@ +package ivr + +import "testing" + +func TestFirstLine(t *testing.T) { + t.Run("returns a users first message in a channel", func(t *testing.T) { + request, _ := FirstLine("forsen", "forsen") + response := "forsen: EZ or Ezy (3y, 9mo, 16d ago)." + + got := request + want := response + + if got != want { + t.Errorf("got %q, want %q", got, want) + } + + }) +} diff --git a/pkg/api/ivr/followage_test.go b/pkg/api/ivr/followage_test.go new file mode 100644 index 0000000..7b4f838 --- /dev/null +++ b/pkg/api/ivr/followage_test.go @@ -0,0 +1,18 @@ +package ivr + +import "testing" + +func TestFollowage(t *testing.T) { + t.Run("returns a users date they followed a channel", func(t *testing.T) { + request, _ := Followage("forsen", "pajlada") + response := "pajlada has been following forsen since 2015-03-09." + + got := request + want := response + + if got != want { + t.Errorf("got %q, want %q", got, want) + } + + }) +}