Skip to content

Project Sample Unit Tests do not run #43

Description

@Marco5793

Hello,

Thanks a lot for this great framework and all effort put in-here.

I am having a hard time running the project's sample unit tests.

I downloaded the framework and could successfully build the "LogicAppUnit.Samples.LogicApps.Tests" Solution.
I ran all Azurite services (3) in the LogicAppUnit.Samples.LogicApps.LogicApps directory.

I tried then to run "dotnet test" in the "LogicAppUnit.Samples.LogicApps.Tests" directory but faced an error regarding JSON child access as you can read below:
Failed BuiltInConnectorWorkflowTest_When_Invalid_Language_Code [2 ms] Error Message: Initialization method LogicAppUnit.Samples.LogicApps.Tests.BuiltInConnectorWorkflow.BuiltInConnectorWorkflowTest.TestInitialize threw exception. System.InvalidOperationException: Cannot access child value on Newtonsoft.Json.Linq.JValue.. Stack Trace: at Newtonsoft.Json.Linq.JToken.get_Item(Object key) at LogicAppUnit.Wrapper.ConnectionsWrapper.<>c.<ListManagedApiConnectionsUsingManagedServiceIdentity>b__5_0(JToken x) in C:\Users\myoucef\Downloads\TestingFramework-main-original\TestingFramework-main\src\LogicAppUnit\Wrapper\ConnectionsWrapper.cs:line 108 at System.Linq.Enumerable.WhereEnumerableIterator1.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at LogicAppUnit.Wrapper.ConnectionsWrapper.ListManagedApiConnectionsUsingManagedServiceIdentity() in C:\Users\myoucef\Downloads\TestingFramework-main-original\TestingFramework-main\src\LogicAppUnit\Wrapper\ConnectionsWrapper.cs:line 108
at LogicAppUnit.WorkflowTestBase.ProcessConnectionsFile(String logicAppBasePath) in C:\Users\myoucef\Downloads\TestingFramework-main-original\TestingFramework-main\src\LogicAppUnit\WorkflowTestBase.cs:line 299
at LogicAppUnit.WorkflowTestBase.Initialize(String logicAppBasePath, String workflowName, String localSettingsFilename) in C:\Users\myoucef\Downloads\TestingFramework-main-original\TestingFramework-main\src\LogicAppUnit\WorkflowTestBase.cs:line 151
at LogicAppUnit.WorkflowTestBase.Initialize(String logicAppBasePath, String workflowName) in C:\Users\myoucef\Downloads\TestingFramework-main-original\TestingFramework-main\src\LogicAppUnit\WorkflowTestBase.cs:line 109
at LogicAppUnit.Samples.LogicApps.Tests.BuiltInConnectorWorkflow.BuiltInConnectorWorkflowTest.TestInitialize() in C:\Users\myoucef\Downloads\TestingFramework-main-original\TestingFramework-main\src\LogicAppUnit.Samples.LogicApps.Tests\BuiltInConnectorWorkflow\BuiltInConnectorWorkflowTest.cs:line 19

Standard Output Messages:


  •                          INITIALIZING TEST                               -    
    

Azurite is listening on ports 10000 (Blob service), 10001 (Queue service) and 10002
(Table service).
Workflow 'built-in-connector-workflow' is Stateful
Replacing workflow trigger 'When_messages_are_available_in_a_queue' with a HTTP Request trigger.
Replacing workflow actions using a built-in connector with a HTTP action for the mock test server:
Send_message_to_Topic:
Connector Type: /serviceProviders/serviceBus/sendMessage
Mocked URL: http://lududfea029:7075/Send_message_to_Topic
Execute_Query_to_get_Language_Name:
Connector Type: /serviceProviders/sql/executeQuery
Mocked URL: http://lududfea029:7075/Execute_Query_to_get_Language_Name
Using local settings file: local.settings.json
Updating local settings file for 'https://external-service-one.testing.net':
ServiceOne-Url:
https://external-service-one.testing.net/api/v1 ->
http://lududfea029:7075/api/v1
Updating local settings file for 'https://external-service-two.testing.net':
ServiceTwo-Url:
https://external-service-two.testing.net/api/v1.1 ->
http://lududfea029:7075/api/v1.1
ServiceTwo-Verison2Url:
https://external-service-two.testing.net/api/v2.0 ->
http://lududfea029:7075/api/v2.0
Updating connections file for managed API connectors:
salesforce:
https://7606763fdc09952f.10.common.logic-uksouth.azure-apihub.net/apim/salesforce/fba515601ef14f9193eee596a9dcfd1c/ ->
http://lududfea029:7075/apim/salesforce/fba515601ef14f9193eee596a9dcfd1c/
outlook:
https://7606763fdc09952f.10.common.logic-uksouth.azure-apihub.net/apim/outlook/79a0bc680716416e90e17323b581695d/ ->
http://lududfea029:7075/apim/outlook/79a0bc680716416e90e17323b581695d/

Failed! - Failed: 53, Passed: 0, Skipped: 0, Total: 53, Duration: 386 ms - LogicAppUnit.Samples.LogicApps.Tests.dll (net6.0)`

I am running the latest version of Azure Func Core tool : 4.0.6821 on VS Code.

Am I missing a step here?

Thanks a lot in advance.
Marc

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions