INNER CODE UNIT · Go

TestAddServiceAddOK

cristianoliveira/ergo · commands/add_service_test.go:23

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

	service := proxy.UnsafeNewService("newtest.dev", "http://localhost:3333")

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

	if result != "Service added successfully" {
		t.Fatalf("Expected AddServiceCommand to add service. Got %s.", result)
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…