INNER CODE UNIT · Go

TestAddServiceAllreadyThere

cristianoliveira/ergo · commands/add_service_test.go:9

func TestAddServiceAllreadyThere(t *testing.T) {
	config := buildConfig([]proxy.Service{
		proxy.UnsafeNewService("test", "http://localhost:9999"),
	})

	service := proxy.Service{Name: "test"}

	command := AddServiceCommand{Service: service}
	result, err := command.Execute(config)
	if err == nil {
		t.Fatalf("Expected to receive error. Result: %s", result)
	}
}

func TestAddServiceAddOK(t *testing.T) {
	config := buildConfig([]proxy.Service{
		proxy.UnsafeNewService("test.dev", "http://localhost:9999"),
	})

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…