Exemplo n.º 1
0
func TestGetFileNameWithQueries_ShouldReturnEncodedFilename(t *testing.T) {
	//GET-/example/query?value=abc&value2=cba = RYK2253FOOJI773UXZASWXUM4AA3CTEF
	expectedFilename := "RYK2253FOOJI773UXZASWXUM4AA3CTEF"
	m := model.MockConf{URI: "/example/query?value=abc&value2=cba", Method: "GET", ContentType: "contentType", StatusCode: 418}
	got := m.GetFileName()
	if got != expectedFilename {
		t.Errorf("Expected: %v but got: %v", expectedFilename, got)
	}
}
Exemplo n.º 2
0
func TestGetFileName_ShouldReturnEncodedFilename(t *testing.T) {
	//Equals to base 32 uri = / method = GET
	expectedFilename := "AZH5Y2SPPMLFNUGNVXRJGON64IUV3FNB"
	m := model.MockConf{URI: "/", Method: "GET", ContentType: "contentType", StatusCode: 418}
	got := m.GetFileName()
	if got != expectedFilename {
		t.Errorf("Expected: %v but got: %v", expectedFilename, got)
	}
}