Skip to content

Commit aa3f53a

Browse files
authored
Changes for 1.11.0.
1 parent 7966a75 commit aa3f53a

29 files changed

+373
-213
lines changed

.azure-devops/pipelines/build.yml

+31-31
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
Windows:
2525
imageName: 'windows-latest'
2626
matrixName: Windows
27-
#Mac:
28-
# imageName: 'macOS-latest'
29-
# matrixName: Mac
27+
Mac:
28+
imageName: 'macOS-latest'
29+
matrixName: Mac
3030

3131
pool:
3232
vmImage: $(imageName)
@@ -35,13 +35,6 @@ jobs:
3535

3636
# Build .NET solution
3737

38-
- task: UseDotNet@2
39-
displayName: 'Setup .NET'
40-
inputs:
41-
packageType: sdk
42-
version: '6.x'
43-
installationPath: $(Agent.ToolsDirectory)/dotnet
44-
4538
- task: DotNetCoreCLI@2
4639
displayName: 'Restore dependencies'
4740
inputs:
@@ -58,26 +51,16 @@ jobs:
5851

5952
# Install and configure Logic Apps runtime environment
6053

61-
- task: NodeTool@0
62-
displayName: 'Setup node'
63-
inputs:
64-
versionSpec: '18.x'
65-
6654
- task: FuncToolsInstaller@0
6755
displayName: 'Install Functions core tools'
6856
inputs:
6957
version: 'latest'
7058

71-
- task: CmdLine@2
72-
displayName: 'Check Functions Core tools installation'
73-
inputs:
74-
script: func
75-
7659
- task: Npm@1
7760
displayName: 'Install Azurite'
7861
inputs:
7962
command: 'custom'
80-
customCommand: 'install -g azurite@3.33.0'
63+
customCommand: 'install -g azurite@3.34.0'
8164

8265
- task: CmdLine@2
8366
displayName: 'Start Azurite services (not Windows)'
@@ -91,6 +74,23 @@ jobs:
9174
inputs:
9275
script: 'start /b azurite'
9376

77+
# Check software versions
78+
79+
- task: CmdLine@2
80+
displayName: 'Check dotnet SDK installation'
81+
inputs:
82+
script: dotnet --info
83+
84+
- task: CmdLine@2
85+
displayName: 'Check node installation'
86+
inputs:
87+
script: node --version
88+
89+
- task: CmdLine@2
90+
displayName: 'Check Functions Core tools installation'
91+
inputs:
92+
script: func --version
93+
9494
# Run tests and publish test results to Azure DevOps
9595

9696
- task: DotNetCoreCLI@2
@@ -104,16 +104,16 @@ jobs:
104104
publishTestResults: true
105105
testRunTitle: 'Tests ($(matrixName))'
106106

107-
- task: DotNetCoreCLI@2
108-
displayName: 'Run tests (Windows)'
109-
condition: and(succeeded(), eq(variables.matrixName, 'Windows'))
110-
continueOnError: true
111-
inputs:
112-
command: test
113-
arguments: '--no-restore --verbosity normal --configuration ${{ parameters.buildConfiguration }}'
114-
projects: '$(System.DefaultWorkingDirectory)/src/LogicAppUnit.sln'
115-
publishTestResults: true
116-
testRunTitle: 'Tests ($(matrixName))'
107+
# - task: DotNetCoreCLI@2 # there is an issue with Azurite ports being blocked when running tests on Windows build servers
108+
# displayName: 'Run tests (Windows)'
109+
# condition: and(succeeded(), eq(variables.matrixName, 'Windows'))
110+
# continueOnError: true
111+
# inputs:
112+
# command: test
113+
# arguments: '--no-restore --verbosity normal --configuration ${{ parameters.buildConfiguration }}'
114+
# projects: '$(System.DefaultWorkingDirectory)/src/LogicAppUnit.sln'
115+
# publishTestResults: true
116+
# testRunTitle: 'Tests ($(matrixName))'
117117

118118
# Publish NuGet package
119119

.editorconfig

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
; This file is for unifying the coding style for different editors and IDEs.
22
; More information at http://EditorConfig.org
33

4-
# top-most EditorConfig file
54
root = true
65

7-
# Don't use tabs for indentation
6+
# All files
87
[*]
98
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
1011

1112
# Code files
1213
[*.{cs,csx}]
@@ -38,3 +39,13 @@ dotnet_diagnostic.CA1310.severity = none
3839
# Underscores are acceptable for unit test names.
3940
[*.cs]
4041
dotnet_diagnostic.CA1707.severity = none
42+
43+
# CA1852: Seal internal types
44+
# Sealing classes provides minimal performance improvements and is not a concern.
45+
[*.cs]
46+
dotnet_diagnostic.CA1852.severity = none
47+
48+
# CA1866: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char
49+
# Implementing this causes the unit tests to break on macOS and Linux platforms!
50+
[*.cs]
51+
dotnet_diagnostic.CA1866.severity = none

.github/workflows/build.yml

+33-35
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ jobs:
2525
uses: actions/checkout@v3
2626

2727
# Build .NET solution
28-
29-
- name: Setup .NET
30-
uses: actions/setup-dotnet@v3
31-
with:
32-
dotnet-version: 6.0.x
3328

3429
- name: Restore dependencies
3530
run: dotnet restore ${{ github.workspace }}/src/LogicAppUnit.sln
@@ -39,11 +34,6 @@ jobs:
3934

4035
# Install and configure Logic Apps runtime environment
4136

42-
- name: Setup node
43-
uses: actions/setup-node@v3
44-
with:
45-
node-version: 18
46-
4737
- name: Install Functions Core tools
4838
run: 'npm install -g azure-functions-core-tools@4 --unsafe-perm true'
4939

@@ -52,40 +42,48 @@ jobs:
5242
run: 'setx /m Path "C:\npm\prefix\node_modules\azure-functions-core-tools\bin;%Path%"'
5343
shell: cmd
5444

55-
- name: Check Functions Core tools installation
56-
run: 'func'
57-
5845
- name: Install Azurite
59-
run: 'npm install -g azurite@3.33.0'
46+
run: 'npm install -g azurite@3.34.0'
6047

6148
- name: Start Azurite services
6249
run: 'azurite &'
6350
shell: bash
6451

52+
# Check software versions
53+
54+
- name: Check dotnet SDK installation
55+
run: 'dotnet --info'
56+
57+
- name: Check node installation
58+
run: 'node --version'
59+
60+
- name: Check Functions Core tools installation
61+
run: 'func --version'
62+
6563
# Run tests
6664

67-
# - name: Run tests
68-
# if: success() && matrix.os != 'windows-latest'
69-
# run: dotnet test ${{ github.workspace }}/src/LogicAppUnit.sln --no-restore --verbosity normal --logger "trx" --filter TestCategory!="WindowsOnly"
65+
- name: Run tests
66+
if: success() && matrix.os != 'windows-latest'
67+
run: dotnet test ${{ github.workspace }}/src/LogicAppUnit.sln --no-restore --verbosity normal --logger "trx" --filter TestCategory!="WindowsOnly"
7068

71-
# - name: Run tests
72-
# if: success() && matrix.os == 'windows-latest'
73-
# run: dotnet test ${{ github.workspace }}/src/LogicAppUnit.sln --no-restore --verbosity normal --logger "trx"
69+
- name: Run tests
70+
if: success() && matrix.os == 'windows-latest'
71+
run: dotnet test ${{ github.workspace }}/src/LogicAppUnit.sln --no-restore --verbosity normal --logger "trx"
7472

7573
# Publish artefacts and test results
7674

77-
# - name: Publish test log
78-
# uses: actions/upload-artifact@v3
79-
# if: success() || failure()
80-
# with:
81-
# name: test-results.${{ matrix.os }}
82-
# path: ${{ github.workspace }}/src/LogicAppUnit.Samples.LogicApps.Tests/TestResults/*.trx
83-
84-
# - name: Publish test results
85-
# if: (success() || failure()) && github.event_name != 'pull_request'
86-
# uses: dorny/test-reporter@v1
87-
# with:
88-
# name: Test Results (${{ matrix.os }})
89-
# path: ${{ github.workspace }}/src/LogicAppUnit.Samples.LogicApps.Tests/TestResults/*.trx
90-
# path-replace-backslashes: true
91-
# reporter: dotnet-trx
75+
- name: Publish test log
76+
uses: actions/upload-artifact@v4
77+
if: success() || failure()
78+
with:
79+
name: test-results.${{ matrix.os }}
80+
path: ${{ github.workspace }}/src/LogicAppUnit.Samples.LogicApps.Tests/TestResults/*.trx
81+
82+
- name: Publish test results
83+
if: (success() || failure()) && github.event_name != 'pull_request'
84+
uses: dorny/test-reporter@v2
85+
with:
86+
name: Test Results (${{ matrix.os }})
87+
path: ${{ github.workspace }}/src/LogicAppUnit.Samples.LogicApps.Tests/TestResults/*.trx
88+
path-replace-backslashes: true
89+
reporter: dotnet-trx

ChangeLog.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 1.11.0 (11th April 2025)
2+
3+
LogicAppUnit Testing Framework:
4+
5+
- The framework now supports parameterised connections that are created by the Standard Logic App extension. [[Issue #42](https://github.com/LogicAppUnit/TestingFramework/issues/42)]
6+
- Bumped versions of NuGet packages to remove critical vulnerabilities in some of the transitive packages.
7+
- Added configuration for NuGet Audit so that any future vulnerabilities are logged as build warnings and do not break the LogicAppUnit build. [[Issue #40](https://github.com/LogicAppUnit/TestingFramework/issues/40)]
8+
- Updated method `ContentHelper.FormatJson()` to use `JToken.Parse()` instead of `JObject.Parse()`. [[Issue #45](https://github.com/LogicAppUnit/TestingFramework/issues/45)]
9+
- Added new property `TestRunner.WorkflowTerminationCodeAsString` that returns the workflow termination code as a string value. The existing property `TestRunner.WorkflowTerminationCode` returns the code as an integer value, but the code is defined as a string data type in the workflow schema reference documentation. [[Issue #46](https://github.com/LogicAppUnit/TestingFramework/issues/46)]
10+
11+
112
# 1.10.0 (4th November 2024)
213

314
LogicAppUnit Testing Framework:

src/Directory.Build.props

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
5+
<!-- Enable code analysis -->
6+
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
7+
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
8+
<AnalysisLevel>latest-recommended</AnalysisLevel>
9+
10+
<!-- Enable NuGet package auditing -->
11+
<NuGetAudit>true</NuGetAudit>
12+
<NuGetAuditMode>all</NuGetAuditMode>
13+
<NuGetAuditLevel>low</NuGetAuditLevel>
14+
15+
<!-- Warnings and Errors -->
16+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
17+
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
18+
19+
</PropertyGroup>
20+
</Project>

src/LogicAppUnit.Samples.LogicApps.Tests/BuiltInConnectorWorkflow/BuiltInConnectorWorkflowTest.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void BuiltInConnectorWorkflowTest_When_Invalid_Language_Code()
189189
}
190190
}
191191

192-
private static HttpContent GetServiceBusMessageForTriggerNoLanguageCode()
192+
private static StringContent GetServiceBusMessageForTriggerNoLanguageCode()
193193
{
194194
return ContentHelper.CreateJsonStringContent(new
195195
{
@@ -228,7 +228,7 @@ private static HttpContent GetServiceBusMessageForTriggerNoLanguageCode()
228228
});
229229
}
230230

231-
private static HttpContent GetServiceBusMessageForTriggerWithValidLanguageCode()
231+
private static StringContent GetServiceBusMessageForTriggerWithValidLanguageCode()
232232
{
233233
return ContentHelper.CreateJsonStringContent(new
234234
{
@@ -268,7 +268,7 @@ private static HttpContent GetServiceBusMessageForTriggerWithValidLanguageCode()
268268
});
269269
}
270270

271-
private static HttpContent GetServiceBusMessageForTriggerWithInvalidLanguageCode()
271+
private static StringContent GetServiceBusMessageForTriggerWithInvalidLanguageCode()
272272
{
273273
return ContentHelper.CreateJsonStringContent(new
274274
{
@@ -308,7 +308,7 @@ private static HttpContent GetServiceBusMessageForTriggerWithInvalidLanguageCode
308308
});
309309
}
310310

311-
private static object GetSQLExecuteResponse()
311+
private static object[] GetSQLExecuteResponse()
312312
{
313313
return new object[]
314314
{
@@ -323,11 +323,9 @@ private static object GetSQLExecuteResponse()
323323
};
324324
}
325325

326-
private static object GetSQLExecuteResponseNoRecords()
326+
private static object[] GetSQLExecuteResponseNoRecords()
327327
{
328-
return new object[]
329-
{
330-
};
328+
return System.Array.Empty<object>();
331329
}
332330
}
333331
}

src/LogicAppUnit.Samples.LogicApps.Tests/LogicAppUnit.Samples.LogicApps.Tests.csproj

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RootNamespace>LogicAppUnit.Samples.LogicApps.Tests</RootNamespace>
66
<IsPackable>false</IsPackable>
7-
<!-- Code analysis -->
8-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9-
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
10-
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
11-
<AnalysisLevel>latest-recommended</AnalysisLevel>
127
</PropertyGroup>
138

149
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -68,7 +63,7 @@
6863
</ItemGroup>
6964

7065
<ItemGroup>
71-
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
66+
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
7267
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
7368
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
7469
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />

src/LogicAppUnit.Samples.LogicApps.Tests/ManagedApiConnectorWorkflow/ManagedApiConnectorWorkflowTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public void ManagedApiConnectorWorkflowTest_When_Send_Email_Fails()
152152
}
153153
}
154154

155-
private static HttpContent GetRequest()
155+
private static StringContent GetRequest()
156156
{
157157
return ContentHelper.CreateJsonStringContent(new
158158
{

src/LogicAppUnit.Samples.LogicApps/connections.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"connection": {
4646
"id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/resourceGroups/@{appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')}/providers/Microsoft.Web/connections/salesforce01"
4747
},
48-
"connectionRuntimeUrl": "https://7606763fdc09952f.10.common.logic-uksouth.azure-apihub.net/apim/salesforce/fba515601ef14f9193eee596a9dcfd1c/",
48+
"connectionRuntimeUrl": "@parameters('salesforce-ConnectionRuntimeUrl')",
4949
"authentication": {
5050
"type": "Raw",
5151
"scheme": "Key",
@@ -59,12 +59,8 @@
5959
"connection": {
6060
"id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/resourceGroups/@{appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')}/providers/Microsoft.Web/connections/outlook01"
6161
},
62-
"connectionRuntimeUrl": "@appsetting('Outlook-ManagedConnectionRuntimeUrl')",
63-
"authentication": {
64-
"type": "Raw",
65-
"scheme": "Key",
66-
"parameter": "@appsetting('Outlook-ConnectionKey')"
67-
}
62+
"connectionRuntimeUrl": "@parameters('outlook-ConnectionRuntimeUrl')",
63+
"authentication": "@parameters('outlook-Authentication')"
6864
}
6965
}
7066
}

src/LogicAppUnit.Samples.LogicApps/local.settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"AzureQueue-ConnectionString": "any-queue-connection-string",
1212
"Outlook-ConnectionKey": "any-outlook-connection-key",
1313
"Outlook-SubjectPrefix": "INFORMATION",
14-
"Outlook-ManagedConnectionRuntimeUrl": "https://7606763fdc09952f.10.common.logic-uksouth.azure-apihub.net/apim/outlook/79a0bc680716416e90e17323b581695d/",
14+
"Outlook-ConnectionRuntimeUrl": "https://7606763fdc09952f.10.common.logic-uksouth.azure-apihub.net/apim/outlook/79a0bc680716416e90e17323b581695d/",
1515
"Salesforce-ConnectionKey": "any-salesforce-connection-key",
16+
"Salesforce-ConnectionRuntimeUrl": "https://7606763fdc09952f.10.common.logic-uksouth.azure-apihub.net/apim/salesforce/fba515601ef14f9193eee596a9dcfd1c/",
1617
"ServiceOne-Url": "https://external-service-one.testing.net/api/v1",
1718
"ServiceOne-Authentication-APIKey": "serviceone-auth-apikey",
1819
"ServiceOne-Authentication-WebHook-APIKey": "serviceone-auth-webhook-apikey",

0 commit comments

Comments
 (0)