From c3d5d0b914d82a93ff4d7be86ceebb5b94e8cb6a Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 11 Nov 2026 12:20:06 +0000 Subject: [PATCH 1/2] Test that the .NET example is given the underscore variable names The .NET cloud web example reads the resource key from _51DEGREES_RESOURCE_KEY and the cloud endpoint from _51DEGREES_CLOUD_ENDPOINT, with no other name, once its rename is released. --- Examples/ExampleAppsTests.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Examples/ExampleAppsTests.cs b/Examples/ExampleAppsTests.cs index 3f271e6..0e5ce16 100644 --- a/Examples/ExampleAppsTests.cs +++ b/Examples/ExampleAppsTests.cs @@ -1,3 +1,5 @@ +using System; +using System.Collections.Generic; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -74,5 +76,23 @@ public void Descriptors_Rust_BuildsAndRunsWithCargo() Assert.IsTrue(rust.Args.Contains("dd-web-getting-started-cloud"), "run args should target the cloud getting-started web binary"); } + + [TestMethod] + public void Descriptors_Dotnet_SetsTheUnderscoreNames() + { + var dotnet = ExampleApps.Descriptors["dotnet"]; + var env = dotnet.BuildEnv(new ExampleAppOptions( + Port: 5123, + CloudEndpoint: new Uri("https://cloud.example.test/"), + ResourceKey: "key", + ExtraEnv: new Dictionary())); + Assert.AreEqual("key", env["_51DEGREES_RESOURCE_KEY"], + "the example reads the resource key from this name"); + Assert.AreEqual( + "https://cloud.example.test/api/v4/", + env["_51DEGREES_CLOUD_ENDPOINT"], + "the example reads the endpoint, with its api/v4 path, " + + "from this name"); + } } } From 01126f7dd955a517ec76a4453ed0f991f11ad32c Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 11 Nov 2026 12:23:14 +0000 Subject: [PATCH 2/2] Give the .NET example the _51DEGREES_ variable names The .NET cloud web example now reads the resource key from _51DEGREES_RESOURCE_KEY and the endpoint from _51DEGREES_CLOUD_ENDPOINT, with no other name. Released versions of it read SUPER_RESOURCE_KEY and FIFTYONE_CLOUD_ENDPOINT, so the harness sets both pairs until every language has released with the new names. --- Examples/ExampleApps.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Examples/ExampleApps.cs b/Examples/ExampleApps.cs index 998fcb4..e234629 100644 --- a/Examples/ExampleApps.cs +++ b/Examples/ExampleApps.cs @@ -238,8 +238,13 @@ public static ExampleAppOptions BuildOptions( StartupTimeoutSeconds: 180, BuildEnv: o => new Dictionary { + // The example reads the _51DEGREES_ names. Released + // versions of it read the two older names, so both + // are set until every language has released. + ["_51DEGREES_RESOURCE_KEY"] = o.ResourceKey, ["SUPER_RESOURCE_KEY"] = o.ResourceKey, // the endpoint must include the api/v4 path + ["_51DEGREES_CLOUD_ENDPOINT"] = new Uri(o.CloudEndpoint, "api/v4/").ToString(), ["FIFTYONE_CLOUD_ENDPOINT"] = new Uri(o.CloudEndpoint, "api/v4/").ToString(), ["ASPNETCORE_URLS"] = $"http://localhost:{o.Port}", // run on a newer .NET runtime if the exact one isn't installed