Skip to content

Commit

Permalink
Added e2e test case for buildResponse function
Browse files Browse the repository at this point in the history
Signed-off-by: viveksahu26 <vivekkumarsahu650@gmail.com>
  • Loading branch information
viveksahu26 committed Sep 14, 2022
1 parent 808d42b commit 4cc3f9e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/buildURLresponse_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package src

import (
"testing"

"gotest.tools/assert"
)

func TestBuildResonse(t *testing.T) {
expected := BuildURLWithResponse("localhost:8080", "duj3P^+d*C", "http://viveksahu.com")
actual := &URLResponse{
OriginalURL: "http://viveksahu.com",
ShortURL: "http://localhost:8080/duj3P^+d*C",
}
assert.Equal(t, expected.ShortURL, actual.ShortURL)
}

0 comments on commit 4cc3f9e

Please sign in to comment.