File: highlevel_test.go

package info (click to toggle)
golang-google-api 0.61.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 209,080 kB
  • sloc: sh: 183; makefile: 22; python: 4
file content (24 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2021 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package mock

import "testing"

// mockService fulfills the TranslateService interface.
type mockService struct{}

func (*mockService) TranslateText(text, language string) (string, error) {
	return "Hello World", nil
}
func TestTranslateTextHighLevel(t *testing.T) {
	svc := &mockService{}
	text, err := TranslateTextHighLevel(svc, "Hola Mundo", "en-US")
	if err != nil {
		t.Fatal(err)
	}
	if text != "Hello World" {
		t.Fatalf("got %q, want Hello World", text)
	}
}