From 3e64876b58fea4ffe8cf21c8f9a25d18d35eaae1 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Tue, 10 Feb 2026 07:46:16 +0100 Subject: [PATCH] Migrate Azure Functions to net10, add Bruno test collection --- Func/Func.csproj | 18 ++++++++++++------ Func/Program.cs | 15 ++++++--------- Func/TestingWithBruno/bruno.json | 9 +++++++++ Func/TestingWithBruno/getVersion.bru | 15 +++++++++++++++ Func/TestingWithBruno/postConversion.bru | 20 ++++++++++++++++++++ 5 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 Func/TestingWithBruno/bruno.json create mode 100644 Func/TestingWithBruno/getVersion.bru create mode 100644 Func/TestingWithBruno/postConversion.bru diff --git a/Func/Func.csproj b/Func/Func.csproj index 313095e2..2b30812f 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -1,6 +1,6 @@  - net8.0 + net10.0 v4 Exe enable @@ -9,15 +9,21 @@ ICSharpCode.CodeConverter.Func <_FunctionsSkipCleanOutput>true - + + + + + + + - + - - + + @@ -27,7 +33,7 @@ - + diff --git a/Func/Program.cs b/Func/Program.cs index ce03e736..6407641a 100644 --- a/Func/Program.cs +++ b/Func/Program.cs @@ -4,15 +4,12 @@ var host = new HostBuilder() .ConfigureFunctionsWebApplication() - .ConfigureServices(services => - { - services.AddApplicationInsightsTelemetryWorkerService(); - services.ConfigureFunctionsApplicationInsights(); - - services.AddCors(options => - { - options.AddPolicy("AllowWeb", builder => - { + .ConfigureServices(services => { + services.AddApplicationInsightsTelemetryWorkerService() + .ConfigureFunctionsApplicationInsights(); + + services.AddCors(options => { + options.AddPolicy("AllowWeb", builder => { builder.WithOrigins("http://localhost:5173") .AllowAnyMethod() .AllowAnyHeader(); diff --git a/Func/TestingWithBruno/bruno.json b/Func/TestingWithBruno/bruno.json new file mode 100644 index 00000000..7a20280a --- /dev/null +++ b/Func/TestingWithBruno/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "CodeConverter", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/Func/TestingWithBruno/getVersion.bru b/Func/TestingWithBruno/getVersion.bru new file mode 100644 index 00000000..a0364185 --- /dev/null +++ b/Func/TestingWithBruno/getVersion.bru @@ -0,0 +1,15 @@ +meta { + name: getVersion + type: http + seq: 1 +} + +get { + url: http://localhost:7144/api/Version + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/Func/TestingWithBruno/postConversion.bru b/Func/TestingWithBruno/postConversion.bru new file mode 100644 index 00000000..d79b2d67 --- /dev/null +++ b/Func/TestingWithBruno/postConversion.bru @@ -0,0 +1,20 @@ +meta { + name: postConversion + type: http + seq: 2 +} + +post { + url: http://localhost:7144/api/Convert + body: json + auth: inherit +} + +body:json { + {"code": "usingSystem;usingSystem.Collections.Generic;usingSystem.Collections.Immutable;usingSystem.Diagnostics;usingSystem.Diagnostics.CodeAnalysis;usingSystem.Linq;usingSystem.Threading;usingSystem.Threading.Tasks;classProgram{staticvoidMain(){Console.WriteLine(\"Hello.\");}}","requestedConversion":"cs2vbnet"} +} + +settings { + encodeUrl: true + timeout: 0 +}