@@ -912,3 +912,46 @@ func (r *ScenarioRunner) selectTransport(client *Client, transport string) *Clie
912912 }
913913}
914914`
915+
916+ var SuiteTestWithResultCode = `// RunWithResultServiceHarness exercises the generated harness against your
917+ // service implementation.// Call this helper from your test, passing your service implementation.
918+ func RunWithResultServiceHarness(t *testing.T, svc withresultservice.Service) {
919+ t.Helper()
920+ ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
921+ defer cancel()
922+
923+ h := withResultServicetest.NewHarness(t, svc)
924+ defer h.Close()
925+
926+ td := withResultServicetest.NewTestData()
927+ t.Run("WithResultMethod", func(t *testing.T) {
928+ result, err := h.Client.WithResultMethod(ctx)
929+ if err != nil {
930+ t.Errorf("WithResultMethod failed: %v", err)
931+ }
932+ if result == nil {
933+ t.Error("WithResultMethod returned nil result")
934+ }
935+ })
936+ }
937+ `
938+
939+ var SuiteTestWithoutResultCode = `// RunWithoutResultServiceHarness exercises the generated harness against your
940+ // service implementation.// Call this helper from your test, passing your service implementation.
941+ func RunWithoutResultServiceHarness(t *testing.T, svc withoutresultservice.Service) {
942+ t.Helper()
943+ ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
944+ defer cancel()
945+
946+ h := withoutResultServicetest.NewHarness(t, svc)
947+ defer h.Close()
948+
949+ td := withoutResultServicetest.NewTestData()
950+ t.Run("WithoutResultMethod", func(t *testing.T) {
951+ result, err := h.Client.WithoutResultMethod(ctx)
952+ if err != nil {
953+ t.Errorf("WithoutResultMethod failed: %v", err)
954+ }
955+ })
956+ }
957+ `
0 commit comments